Time format in Access DB

  • Thread starter Thread starter Targa
  • Start date Start date
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!
 
DateTimeValue.ToString("hh:mm tt")

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
that's asp.net Kev :-)
in Access,
select format(DateTimeColumn, 'hh:mm ampm')

Jon
Microsoft MVP - FP
 
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.
 
Thanks for the quick reply!!!

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

Thanks.
 
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.
 
Gives me a syntax error:

response.write format(mytime,'hh:mm ampm')
-----------------------------^
 
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
 

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

Back
Top