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

How to include condition for Date field?

P: 33
Hi ppl,

I would like to know how to provide condition for Date fields. i wanna do something like this:

i have a field named 'FinishJob' in tableJob (with a drop-down menu with values like "10 days", "14 days", "20 days"). Every job has the field "JobStartDate".

If the JobStartDate is on 20/07/2007 and the 'FinishJob' is 10 days, then the Job has to be completed on 30/07/2007.

I wanna know how to prompt the user abt the Jobs to be finished within 5 days.

When i Press a Button "Check for Job List", it should list all the jobs which are to be completed within the next five days.

Could anyone assist me in this regard.

thanks,
Kathy
Jul 20 '07 #1
Share this Question
Share on Google+
5 Replies


Rabbit
Expert Mod 10K+
P: 12,315
Is FinishJob the number of days or is it the date it needs to be finished?
Jul 20 '07 #2

hyperpau
Expert 100+
P: 184
Hi ppl,

I would like to know how to provide condition for Date fields. i wanna do something like this:

i have a field named 'FinishJob' in tableJob (with a drop-down menu with values like "10 days", "14 days", "20 days"). Every job has the field "JobStartDate".

If the JobStartDate is on 20/07/2007 and the 'FinishJob' is 10 days, then the Job has to be completed on 30/07/2007.

I wanna know how to prompt the user abt the Jobs to be finished within 5 days.

When i Press a Button "Check for Job List", it should list all the jobs which are to be completed within the next five days.

Could anyone assist me in this regard.

thanks,
Kathy
Create a Form that would list all the Jobs to be finished within the next five days when the "check for Job list" is clicked.

This form should be bound to a parameter query.
On the parameter query, insert a new field which uses the DateDiff() function.
then on the criteria of that Field, put =5.
Now the Date diff function calculates the difference in days of the End Date and the Start Date. but the query will only display the items if the difference is "5". There fore the form would also show only those that the query would show.
the query would work behind the scenario, since only the form would be showing when the button is clicked.
Jul 20 '07 #3

P: 33
thanks for your reply.

FinishDate is the date where the job must be finished.

I need to list all the jobs between the current date and the finish date.

i know it is easy to acheive this but i could come up with a solution.

i appreciate your help.

thanks n regards,
Kathy
Jul 22 '07 #4

Rabbit
Expert Mod 10K+
P: 12,315
Expand|Select|Wrap|Line Numbers
  1. SELECT *
  2. FROM TableName
  3. WHERE DateDiff("d", Date(), FinishJob) <= 5;
  4.  
Jul 23 '07 #5

P: 33
Thanks a lot for your work..
Am learning new stuffs everyday from this forum.

love,
Kathy
Jul 23 '07 #6

Post your reply

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