bradlee27514
IS-IT--Management
I have a query pulling some data in a SQL command
something like
select
table.invoicenumber,
table.invoicedate
from
table
What I want to do is restrict the records in the SQL command based on the invoicedate field, something like
where
table.invoicedate =< currentdate and
table.invoicedate => (currentdate - 3)
So invoices 3 days or older up to today
I know how to do this inside Crystal Reports, however I want to do it in the SQL command before the data even gets there. This is for several reasons, one of which is to speed up the report running. Does such syntax exist in SQL, does it know what the current date is?
something like
select
table.invoicenumber,
table.invoicedate
from
table
What I want to do is restrict the records in the SQL command based on the invoicedate field, something like
where
table.invoicedate =< currentdate and
table.invoicedate => (currentdate - 3)
So invoices 3 days or older up to today
I know how to do this inside Crystal Reports, however I want to do it in the SQL command before the data even gets there. This is for several reasons, one of which is to speed up the report running. Does such syntax exist in SQL, does it know what the current date is?