This topic is locked
[SOLVED]

 Using The Current Date

1/3/2013 4:08:23 AM
ASPRunnerPro General questions
A
adnankmk author

I have used datediff function to calculate the age of the employees. I used the following function in the select statement of sql query designer.
ELECT emp_id,

emp_Name,

emp_Fname,

Designation,

Scale,

Dob,

Doapp,

(datediff("dd",[Dob],[now()])%365%30) as days

FROM dbo.LGCD_Employees1
It gives an error saying the now() function is not allowed. I want to insert the current date of the system. What function I should use.
Thanks in advance

Sergey Kornilov admin 1/3/2013

You need to find what date functions your database supports. now() is a PHP function and you cannot use it in SQL query.
Google "<your database type> get current date"