Time format in Access DB

T

Targa

Hi,

Ive got several times stored in an access db. The format is "Medium Time"
and in the db it looks like 12:00 AM - which is what I want, but when I pull
the data to an asp page, it's displayed as 12:00:00 AM.

How can I get rid of the extra :00?

Thanks!
 
K

Kevin Spencer

DateTimeValue.ToString("hh:mm tt")

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
J

Jon

that's asp.net Kev :)
in Access,
select format(DateTimeColumn, 'hh:mm ampm')

Jon
Microsoft MVP - FP
 
K

Kevin Spencer

OOPs! Thanks Jon. Haven't been doing ASP for awhile...

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
T

Targa

Thanks for the quick reply!!!

So how do I translate <%=FP_FieldVal(fp_rs,"Sched_Start")%>
into
select format(DateTimeColumn, 'hh:mm ampm')

Thanks.
 
K

Kevin Spencer

The code Jon gave you would run inside your query, and return the formatted
results as a string.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
T

Targa

Gives me a syntax error:

response.write format(mytime,'hh:mm ampm')
-----------------------------^
 
J

Jon

Hi,
put my code in your sql query - for example
select field1, format(datetimefield, 'hh:mm ampm') AS TheTime
from table
then you can just display the time on your page with something like
response.write YourRecordset("TheTime")

Jon
 
Top