ymeaga1n
IS-IT--Management
- Apr 13, 2007
- 2
I need some help guys. I'm pretty new to SQL and I don't know if what I'm trying to do is allowed. I'm running a query on an Access datatable.
I want query to display 3 columns to me.
Column 1 = Date.
Column 2 = Total Sales on that date.
Column 3 = Total Sales from year ago.
I ran the following query but I get a blank third column. I've highlighted that part of the code with blue. Any ideas as to why it's not working, or what I could do to make it work?
SELECT data_bdat AS [Sales Date], data_sls AS [Total Sales], (select fv.data_fv_sls from table1 where data_bdat = data_bdat - 364) AS [Last Year Sales] FROM table1;
I want query to display 3 columns to me.
Column 1 = Date.
Column 2 = Total Sales on that date.
Column 3 = Total Sales from year ago.
I ran the following query but I get a blank third column. I've highlighted that part of the code with blue. Any ideas as to why it's not working, or what I could do to make it work?
SELECT data_bdat AS [Sales Date], data_sls AS [Total Sales], (select fv.data_fv_sls from table1 where data_bdat = data_bdat - 364) AS [Last Year Sales] FROM table1;