title: How to do a query to compare this year vs last year sales?
body: <p>I'm relatively new to SQL and trying to make a simple query to look at this years sales on a day vs last year same date or ideally same day of the week.</p>
  
  <p>I have created the following query which currently based on a single set day. I will need to move this to get todays date really but thought id tackle that one later.</p>
  
  <p>-</p>
  
  <pre><code>Below is the query
  -strtrdecode = store location
  -dtmtradedate = transaction date
  -cursales = sales value
  -Target = will contain Targets but i haven't generated any yet but need to show -the field
  </code></pre>
  
  <p>Would someone please show me how to show both this year and last year figures please on the same line for each store</p>
  
  <p>i.e </p>
  
  <pre><code>liverpool, 01/06/2015, 4000,3000
  blackpool, 01/06/2015, 6000, 7500 etc..
  </code></pre>
  
  <p>Thank you in advance</p>
  
  <p>Mike</p>
  
  <pre><code>TABLE_CATALOG   TABLE_SCHEMA    TABLE_NAME  COLUMN_NAME
  &gt; DRSData   dbo DAILYSALES  STRSALETYPE 
  &gt; DRSData   dbo DAILYSALES  STRTRADECODE
  &gt; DRSData   dbo DAILYSALES  CURSALES
  &gt; DRSData   dbo DAILYSALES  DTMTRADEDATE
  &gt; DRSData   dbo DAILYSALES  INTTRANSNUM
  
  
  
   *SELECT        strtradecode, dtmtradedate, sum(cursales) as [Actual SALES TY], '' as Target
      FROM            DAILYSALES 
                               where (STRSALETYPE = 'H' )and (DTMTRADEDATE BETWEEN CONVERT(DATETIME, '2015-06-01 00:00:00', 102) AND CONVERT(DATETIME, '2015-06-01 00:00:00', 
                               102))
                               group by strtradecode, dtmtradedate*
  </code></pre>