Can any one give me the SQL statement using BETWEEN keyword with two dates. In the SQL Statement, the date range to be mentioned as a variable which should picked the date from DateTimePicker.
What database are you using? The trick is the date format for the database. I'm not sure about others but for MSSQL you could do something like this:
myQuery.sql.add('select * from yourtable where');
myQuery.sql.add('datefield between '''+formatdatetime('mm/dd/yyyy',datepicker1.date)+'''');
myQuery.sql.add('and '+formatdatetime('mm/dd/yyyy',datepicker2.date)+'''');
Which /should/ yield a query something like select * from yourtable where datefield between '05/01/2001' and '06/01/2001'TealWren
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.