|
-
Nov 9th, 2000, 11:23 PM
#1
Thread Starter
New Member
i have a table named orders in MS Access database.This table has a column named dateofcreation.I want to extract data available in the table between two dates.These two dates are available in two text boxes say text1 and text2.The dates are entered in two the textboxes in the format dd/mm/yy.How can I write a query in such a way that i can extract data available in the table between these two dates.The database is MS ACCESS.
Can any one help me out.
Thank you.
Pavan.D
-
Nov 10th, 2000, 04:25 AM
#2
Fanatic Member
[B]Try This[/]
I set a date of 01/01/80 into the dateofcreation when its empty with the IIF command.
code
dbs.Execute "SELECT * FROM table" _
& "WHERE " _
&"IIF(ISNULL(table.dateofcreation),'#01/01/80#',table.dateofcreation) " _
& "BETWEEN DateValue(' " & Text1 & " ') AND " _
& "DateValue(' " & Text2 & " ') " , dbFailOnError
Cheers
Ray
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|