Im stuck with this problem for the past 2 days ....... plz plz plz help me ......!!!
i have a table containing "production_orders". With feilds (BatchNumber, IssueDate) and some other fields
I want to get thoses production orders who fall between the two given dates.
The user inputs these dates on the 2 textboxes i have mentioned above. Or selects one of the frame options eg. this Month, Last Month so these textboxes are filled automatically with dates Plz check the attached picture
But the query is not working correctly. There is some problem with the dates.
i have built some funtions to get dates eg ( First date of current month , fisrt date of previous month, last date of previous month, last date of current month).
CritIssueDt = " Where ((Production_Orders.IssueDate) Between [Forms]![Production Menu]![StartDate] And [Forms]![Production Menu]![EndDate])"
Now towards the real problem:
I have checked that the date funtions return the dates correctly. The functions first update the text boxes and the date values for criteria are taken from the text boxes and not the funtions dirctly. So I'm confident that the funtions for date calculation are working fine.
For example: the user selects "This Month" option then text boxes are alloted values 01/03/2006 and 31/03/2006 respectively. Then the listbox record source if requeryed.
But incorrect records are retieved. After requry of listbox record source, I have checked the criteria in the query editor. The dates are changed to 03/01/2006 and 03/31/2006 respectively. I have even tried to format these dates eg. format(StatDate,"dd/mm/yyyy") before passing dates to the query.
The Short Date Format in the regional settings is dd/MM/yyyy.
I am using access 2003 but my database file is Acess 2000 File. My Operating System = WinXp
Plz help me
i have a table containing "production_orders". With feilds (BatchNumber, IssueDate) and some other fields
I want to get thoses production orders who fall between the two given dates.
The user inputs these dates on the 2 textboxes i have mentioned above. Or selects one of the frame options eg. this Month, Last Month so these textboxes are filled automatically with dates Plz check the attached picture
But the query is not working correctly. There is some problem with the dates.
i have built some funtions to get dates eg ( First date of current month , fisrt date of previous month, last date of previous month, last date of current month).
CritIssueDt = " Where ((Production_Orders.IssueDate) Between [Forms]![Production Menu]![StartDate] And [Forms]![Production Menu]![EndDate])"
Now towards the real problem:
I have checked that the date funtions return the dates correctly. The functions first update the text boxes and the date values for criteria are taken from the text boxes and not the funtions dirctly. So I'm confident that the funtions for date calculation are working fine.
For example: the user selects "This Month" option then text boxes are alloted values 01/03/2006 and 31/03/2006 respectively. Then the listbox record source if requeryed.
But incorrect records are retieved. After requry of listbox record source, I have checked the criteria in the query editor. The dates are changed to 03/01/2006 and 03/31/2006 respectively. I have even tried to format these dates eg. format(StatDate,"dd/mm/yyyy") before passing dates to the query.
The Short Date Format in the regional settings is dd/MM/yyyy.
I am using access 2003 but my database file is Acess 2000 File. My Operating System = WinXp
Plz help me