|
-
Mar 30th, 2006, 08:43 PM
#1
Thread Starter
New Member
[RESOLVED] Retrieve Dates in MS Access
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
-
Mar 30th, 2006, 09:19 PM
#2
Frenzied Member
Re: Retrieve Dates in MS Access
i think you need to compute for the proper date first before querying it
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 30th, 2006, 09:23 PM
#3
Frenzied Member
Re: Retrieve Dates in MS Access
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
On error goto Trap
Trap:
in case of emergency, drop the case...
****************************************
If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option. if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar
-
Mar 30th, 2006, 09:48 PM
#4
Thread Starter
New Member
Re: Retrieve Dates in MS Access
Ei thanks pal it works ...
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
|