Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 SQL query, Please help

Author  Topic 

matkwan
Starting Member

36 Posts

Posted - 2004-05-31 : 10:42:58
Hi,

I have this SQL to display the assignment name and due date:
* Select AssignmentName, DueDate from AssignmentTable

Results:
Assignment1, 1/2/2004
Assignment2, 1/2/2004
Assignment3, 1/3/2004
Assignment4, 1/4/2004
Assignment5, 1/4/2004

Is it possible to include a column to flag 4 weeks before the Due Date ?

Eg,
Assignment1, 1/2/2004,
Assignment2, 1/2/2004,
Assignment3, 1/3/2004,
Assignment4, 1/4/2004, Need Attention
Assignment5, 1/4/2004, Need Attention

Matthew

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-05-31 : 19:29:39
It is possible.

Use the DateAdd function to calculate the +- 4 weeks e.g. DateAdd(d, 28, AssignmentDate)
And use the IIF function to determine if the calculated date is before or after the current date.

Check out the Access/JET help files for more info.

Tim
Go to Top of Page
   

- Advertisement -