Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime literals

Status
Not open for further replies.

happyabc

IS-IT--Management
Mar 10, 2004
164
IN
What is form prescribed by ANSI for DateTime literals.
 
In ISO SQL datetime is a collective name for values of type date, time or timestamp.

date literals:

Code:
date '2004-04-23'

time literals:

Code:
time '03:56:28'

timestamp literals:

Code:
timestamp '2004-04-23 03:56:28'

Time and timestamp literals may have an optional fraction of seconds, e.g

Code:
timestamp '2004-04-23 03:56:28.234505678'

For time and timestamp values a time zone displacement may be included

Code:
time '03:56:28-01:30'

In addition to datetime values there is intervals which denotes periods of time. I don't if you are interested in that.
 
Right, not interested in intravels; but what is the difference between ISO and ANSI SQL.

BTW, I wonder if you happen to know the rules for date/time literals in VB?
 
There is no difference between ANSI and ISO SQL (in content). It is ISO that defines the standard and afterwards it is acknowlegded by national standard bodies.

Dates and times in VB are specified as

#2004-04-23# and #12:13:14#

There are some other date formats (depending on LCID settings) that are recognized.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top