Hey was wondering if someone would be able to direct me down the right path
I am trying to tie invoices within a date range as so:
Year 08 = 1/4/08-31/3/09
Year 09 = 1/4/09-31/3/10
Year 10 = 1/4/10-31/3/11
So far have managed to match invoices within year 08 as can see from the "WHERE" statement below. But I am trying to get it fix so that It will prompt user for Year, they enter and shows the invoices within that date range
Tried to consider if statement but no luck
I am trying to tie invoices within a date range as so:
Year 08 = 1/4/08-31/3/09
Year 09 = 1/4/09-31/3/10
Year 10 = 1/4/10-31/3/11
So far have managed to match invoices within year 08 as can see from the "WHERE" statement below. But I am trying to get it fix so that It will prompt user for Year, they enter and shows the invoices within that date range
Code:
SELECT [Capital Expenditure].[Invoice Number],
[Capital Expenditure].[Order Number],
[Capital Expenditure].[Date of Order],
[Capital Expenditure].[Date of Delivery],
[Capital Expenditure].[Delivery Note No],
[Capital Expenditure].[Nett Value],
[Capital Expenditure].Supplier,
FROM [Capital Expenditure]
WHERE ((([Capital Expenditure].[Date of Order]) Between #4/1/2008#
And #3/31/2009#));
Tried to consider if statement but no luck
Code:
IF ((([Capital Expenditure].[Date of Order]) Between #4/1/2008#
And #3/31/2009#)) THEN Year 08
ELSE IF ((([Capital Expenditure].[Date of Order]) Between #4/1/2009#
And #3/31/20010#)) THEN Year 09
ELSE IF ((([Capital Expenditure].[Date of Order]) Between #4/1/20010#
And #3/31/20011#)) THEN Year 10