-
1
- #1
mpemberton
Programmer
This should be helpful to those trying to write a SQL command and doing a date selection.
Here is an example of using the date in the SQL command:
"SELECT InvoiceDate, InvoiceNumber, SOConfirmTo, SOCustomerPONumber, SOSalesOrderNumber, SONonTaxableSalesAmt FROM ARN_InvHistoryHeader WHERE (InvoiceDate>={d '" & byear & "-" & bmonth & "-" & bday & "'}) AND (InvoiceDate<={d '" & eyear & "-" & emonth & "-" & eday & "'}) ORDER BY InvoiceDate"
Please note the variables used:
byear is the beginning year
bmonth is the beginning month
bday is the beginning day
eyear is the ending year value, etc.
Also make sure you use 2 digit months and days in for all values. Like 01, 02, 03, etc.
If that isn't the most unusual way of specifying dates. Anyway, I hope this helps.
Thanks,
Mark Pemberton
Here is an example of using the date in the SQL command:
"SELECT InvoiceDate, InvoiceNumber, SOConfirmTo, SOCustomerPONumber, SOSalesOrderNumber, SONonTaxableSalesAmt FROM ARN_InvHistoryHeader WHERE (InvoiceDate>={d '" & byear & "-" & bmonth & "-" & bday & "'}) AND (InvoiceDate<={d '" & eyear & "-" & emonth & "-" & eday & "'}) ORDER BY InvoiceDate"
Please note the variables used:
byear is the beginning year
bmonth is the beginning month
bday is the beginning day
eyear is the ending year value, etc.
Also make sure you use 2 digit months and days in for all values. Like 01, 02, 03, etc.
If that isn't the most unusual way of specifying dates. Anyway, I hope this helps.
Thanks,
Mark Pemberton