-
May 13th, 2011, 07:39 PM
#1
Help
So I am new to database reasoning, and my work currently wants to implement Access 2007. I'm stuck though. I'm trying to create a macro for a table so that the table will display all dates from 9 months and prior. Does anyone know how to write this code!?!?!
-
May 13th, 2011, 10:50 PM
#2
Re: Help
You will want to create a select query and use a where clause to filter the data. Access has a wizard to help with this, a wysiwyg and the ability to type in sql directly to create the query. What you would need assuming the date is in an actual date field is something like
Select * from MyTable where TransDate<=#TargetDate#;
Where TargetDate is the cut off date
You can also do
Select * from MyTable where TransDate<=#[Enter Date]#;
To prompt the user for the date to use.
Both queries will return all columns of all rows which match the date criteria.
Last edited by DataMiser; May 13th, 2011 at 10:53 PM.
Always use [code][/code] tags when posting code.
-
May 13th, 2011, 11:06 PM
#3
Re: Help
A macro implies VBA, rather than VB6. The code that you use for the query is the same, though
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
|