am or pm in time ?

J

Joe Van Meer

HI all,

In my sql query for my app how do I determine if the datetime value in the
database is am or pm?

Cheers & thanks, Joe
 
K

Kevin Spencer

What kind of database are we talking about?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
J

Joe Van Meer

Hi again,

Sry, it is sql server 2000 and I am storing a value like : 1/2/2005 1:03:00
AM.

I did not locate the argument for the datepart function for am or pm.

Cheers, Joe :)
 
J

Joe Van Meer

I guess what I am really getting at is how to compare 2 datetime values in
the above format to the minute.

Cheers, Joe :)
 
K

Kevin Spencer

The DATEPART function, when used with hours, will return a number between 0
and 23.

It is important to remember that what you see is a formatted date, but what
the database sees is a number. Humans like to see things in different ways,
but in truth and in fact, there are 24 hours in a day, and the hour part of
a date will therefore always be a number between 0 and 23.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
J

Joe Van Meer

Thanks gentlemen! Totally forgot about that Kevin, thx for reminder.

Cheers, Joe :)
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top