System Date

How to extract the values from table based on the current date. How to write the query?
Select event_code from table name where date = sysdate
What will be added in the place of sysdate? This query will run daily to fetch the records.

Showing Answers 1 - 6 of 6 Answers

teja

  • Mar 8th, 2017
 

GETDATE()

  Was this answer useful?  Yes

Shiv

  • May 18th, 2017
 

Select event_code from tablename where date=convert(varchar(10),getdate(),105)
GetDate() --- will give you the current date time
Convert function is used to convert the Date Time to Date
Using 105 code in the Convert function to convert it to DD-MM-YYYY Format

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions