Date Ranges via Parameters with different Driver DataLinks.

Category

Rave - General

Question

How do I get a Date Range using Parameters, when using Driver DataLinks inside the Rave IDE?

Solution

Sadly, the processing of Dates (and Times and TimeStamps) differ between the various Database Engines. Following is how to select all the dates in 2003 for some of the different Engines.

MS SQL Server via ADO

Query Property:

Select
 T1.*
 From
 Table1 T1
 Where
 (T1.InvDate = ':StartDate') and (T1.InvDate <= ':EndDate')

QueryParams Property:
Note: US Format Dates Required.

startdate = param.startdate('01/01/2003')
enddate = param.enddate('12/31/2003')

MS Access via ADO

Query Property:

Select
 T1.*
 From
 Table1 T1
 Where
 (T1.InvDate = #:StartDate#) and (T1.InvDate <= #:EndDate#)

QueryParams Property:
Note: US Format Dates Required.

startdate = param.startdate('01/01/2003')
enddate = param.enddate('12/31/2003')