By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

Need a Query...

P: 7
Dear Team,

I need to write a query from one table say Employee in MS Access
Following is Structure :
Emplyee Date of Birth = dd/mm/yyyy
Extract Date= dd/mm/yyyy

In this table Extract date field value will be same through the all rows. This field be refreshed after every 1 month.
I need to take Month & Year from this field (Say Field Value for Extract Date is 11/30/2010) so I need to write a query to find all the employees having date of Birth in Month Of Nov 2010.

Feb 1 '10 #1
Share this Question
Share on Google+
4 Replies

Expert 2.5K+
P: 3,072
The extract date is obsolete, as you need just all employees having a certain month of birth.
The Extract date can always been "constructed" by taking the "running" Year and Month...

Check out the Format("datefield","format string") function to solve your query.

Feb 2 '10 #2

P: 7
Thanks Nico. Will it work IF I need to take out teh value of Extract_Dt from another table with the same crieria.
Feb 2 '10 #3

Expert 2.5K+
P: 3,072
We first need to establish why you want to store the Extract date.
If it's for securing to run the extraction only once a month, than an extra system table with the LastRun date can be an option.
When you want to record which rows have been extracted with the run, than you need to record a LastExtracted date after the selection with an UPDATE query.
Finally you can offer the user the most flexible solution by having them to choose the Month and you select dynamically those employees.
For the "Month of Birth" only the month is needed, not the year :-)

Clear ?

Feb 2 '10 #4

P: 7
Dear Nico,

The issue got resolved. Thank you very much.

Feb 5 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.