Anyname Donotcare
Anyname Donotcare

Reputation: 11423

How to allow datetime field to accept AM and PM

I have a field in my database of type DateTime but i configure it to be just a time like that 10:00 .

Now i wanna to accept the time in the format like that :

10:00 AM or 10:00 PM ..

Upvotes: 1

Views: 202

Answers (1)

Soner Gönül
Soner Gönül

Reputation: 98858

  1. Get the all DateTime in your query
  2. Use IF for your field
  3. Use syntax like

    If (Hours of Datetime > 12) Then Hours of Datetime - 12 + "PM"

I agree this is little bir confused but this is the structure you should follow.

Upvotes: 1

Related Questions