Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

working with dates in SQL

Hi guys, looking for help with a problem with a small database I am setting up.
My dbase has only 2 tables which are

Personal Table-
Employee ID (primary key)
First Name
Last Name
Address
Phone No
Mobile Phone
Email
DoB
NPK (foreign Key)

UKCC Table -
NPK (primary key)
Practice
UKCC Number
UKCC expiry date
Working Hours
No Of day worked
PD review date

Now the problem I have is when creating a query to 'flag up' expiry dates 30 day before it does expire. I have no problems in cretaing the SELECT statement or FROM statement (as is always the case), and most of the WHERE statement i.e. linking the tables.
I know I cannot just subtract a integer from the expiry date, this is where I am struggling.
Any help would be greatly appreciated.
[853 byte] By [rodmc] at [2007-11-11 7:46:21]
# 1 Re: working with dates in SQL
SQL Server? Take a look at the DATEDIFF function mate...

Cheers,

Paul
PaulMcM at 2007-11-11 23:47:39 >