B
Bre-x
Hi,
I have a table that has a date field = MM/DD/YYYY = 12/31/2004
I have this function that helps me to query my table:
Function CR(FY, FM, TY, TM) As Integer
Dim Q As String
Q = "SELECT Y, M, Dates, SO, Inv, CustID, Cust, CustOrder, JobNum, Desc INTO
YearInv FROM X_Inv WHERE Dates>=#" & FM & "/01/" & FY & "# And Dates<=#" &
TM & "/31/" & TY & "#;"
DoCmd.SetWarnings False
DoCmd.RunSQL Q
DoCmd.SetWarnings True
CR = DLookup("[count]", "SysCountYear")
End Function
If I am query a month that ends on 31 works fine but not for April or
February that ends on 28 or 29
Any idea how can i fix it?
Thanks
Bre-x
I have a table that has a date field = MM/DD/YYYY = 12/31/2004
I have this function that helps me to query my table:
Function CR(FY, FM, TY, TM) As Integer
Dim Q As String
Q = "SELECT Y, M, Dates, SO, Inv, CustID, Cust, CustOrder, JobNum, Desc INTO
YearInv FROM X_Inv WHERE Dates>=#" & FM & "/01/" & FY & "# And Dates<=#" &
TM & "/31/" & TY & "#;"
DoCmd.SetWarnings False
DoCmd.RunSQL Q
DoCmd.SetWarnings True
CR = DLookup("[count]", "SysCountYear")
End Function
If I am query a month that ends on 31 works fine but not for April or
February that ends on 28 or 29
Any idea how can i fix it?
Thanks
Bre-x