Include milliseconds in time literal in SQL?

A

Armin Zingler

Hi,

in a datetime field in a database, the date/time value is
11/21/2005 09:30:45.753. The interesting part is the seconds. It's 45.753
seconds. How do I query for this exact value? Maximum resolution seems to be
seconds: "...where value=#21/11/2005 09:30:45#"
This is not allowed: "...where value=#21/11/2005 09:30:45.753#
This not, too: "...where value=#21/11/2005 09:30:45:753#

So, how do I include the milliseconds in a time literal in an SQL?


Armin
 
C

Cowboy \(Gregory A. Beamer\)

SELECT * FROM TABLE
WHERE VALUE='2005-11-21 07:05:07.810'

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***********************************************
Think Outside the Box!
***********************************************
 
A

Armin Zingler

Cowboy (Gregory A. Beamer) said:
SELECT * FROM TABLE
WHERE VALUE='2005-11-21 07:05:07.810'

This is not a valid date/time format. Date/time literals must be enclosed in
'#'. The ''' indicates a string, thus I get a data type mismatch error.


Armin
 
C

Cor Ligthert [MVP]

Armin,

You know that your litterals are wrong, you use European standard, the
literarls are in the current versions still all based on USA notation.

(and therefore I don't like them, gives me to much confusion)

Just to bring your attention on.

Cor
 
A

Armin Zingler

Cor Ligthert said:
Armin,

You know that your litterals are wrong, you use European standard,
the literarls are in the current versions still all based on USA
notation.

(and therefore I don't like them, gives me to much confusion)

Just to bring your attention on.


You're right. I mistyped in the posting only. Must have been
11/21/2005 of course. Thanks!


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top