Previous Topic

Next Topic

Inhoudsopgave

Book Index

Current_Date / Current_Time

Current_Date() / Current_Time()

Returns the current date / current time on the system where the server is running.

Example

select Current_Date() as CurrentDate

select Current_Time() as CurrentTime

Difference

MS SQL Server only has the function SysDateTime, which returns a datetime value. Simulating the ASE Current_Date and Current_Time functions is simple, however.

select cast(SysDateTime() as Date) as CurrentDate

select cast(SysDateTime() as Time) as CurrentTime