Hello can you please give me an example ... on how can i retrieve a query that only retrieves 2 Monhts old Record..
Table Name : Part_History
Field Name : HDate, HPartName and HPartNo
Printable View
Hello can you please give me an example ... on how can i retrieve a query that only retrieves 2 Monhts old Record..
Table Name : Part_History
Field Name : HDate, HPartName and HPartNo
i think you need to compute for the proper date first before querying it
try this one
VB Code:
Dim Dat As String Dat = Format(DateAdd("m", -2, Now), "mm/dd/yy") "select * from TableName Where DateFieldToBeQuerried = '" & Dat & "'" 'this gets those records that are exactly 2 months old "select * from TableName Where DateFieldToBeQuerried < '" & Dat & "'" 'this gets those records that are Less than 2 months old "select * from TableName Where DateFieldToBeQuerried > '" & Dat & "'" 'this gets those records that are greater than 2 months old
Ei thanks pal it works ...