BobRosas
asked on
need date range for one year but shows all
The following code which I have in my query is showing all years even tho txtFrom and txtTo show only the year 2007. Can someone please tell me what I am doing wrong?
Thanks in advance!
Between (Format([Forms]![frmPieces ]![txtFrom ],"mm/dd/y yyy")) And (Format([Forms]![frmPieces ]![txtTo], "mm/dd/yyy y"))
Thanks in advance!
Between (Format([Forms]![frmPieces
Is the value of txtFrom and txtTo 2007 or like 11/27/2007? If its only 2007 then the format may not be formatting correctly...
ASKER
It's like 11/27/07, txtFrom format is set to short date. Thanks for your reply.
Could you post the query you are using? I tested that statement and it worked perfectly for me...
ASKER
Gladly. Thanks so much!
SELECT DISTINCT Format([TimeIn],"mm/dd/yyy y") AS Expr1
FROM dbo_MasterJobCodeList INNER JOIN dbo_EmployeeHours ON dbo_MasterJobCodeList.JobC ode = dbo_EmployeeHours.JobCode
GROUP BY Format([TimeIn],"mm/dd/yyy y")
HAVING (((Format([TimeIn],"mm/dd/ yyyy")) Between (Format([Forms]![frmPieces ]![txtFrom ],"mm/dd/y yyy")) And (Format([Forms]![frmPieces ]![txtTo], "mm/dd/yyy y"))));
SELECT DISTINCT Format([TimeIn],"mm/dd/yyy
FROM dbo_MasterJobCodeList INNER JOIN dbo_EmployeeHours ON dbo_MasterJobCodeList.JobC
GROUP BY Format([TimeIn],"mm/dd/yyy
HAVING (((Format([TimeIn],"mm/dd/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The reason I used Group By instead of Where is becasue honestly I didn't think it mattered, but thanks for the tip. Also, you were right, the text boxes were not displaying what I expected. I should be able to troubleshoot and fix it now.
Thanks so much for your help!!
Thanks so much for your help!!
ASKER
The reason I used Group By instead of Where is becasue honestly I didn't think it mattered, but thanks for the tip. Also, you were right, the text boxes were not displaying what I expected. I should be able to troubleshoot and fix it now.
Thanks so much for your help!!
Thanks so much for your help!!