•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 391,618 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,699 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 1435 | Replies: 3 | Solved
![]() |
•
•
Join Date: Jan 2007
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 0
I'm using this code to place Time\Date stamps in specific Access Columns:
I get the correct answer:
1/30/2007 7:49:19 AM
But it is going into the Jan30PM column, not the Jan30AM Column. Shouldn't it be reading 7 as less than 12? Is there anyway to parse for the AM/PM part of the Date Function??
Thanks
asp Syntax (Toggle Plain Text)
Dim conn,strsql,sql_update,ssn,cps,hdDate,TOD,PageDate,h h=hour(now()) ssn = "Select SSN From CWCT07 where SSN = '" & Request.Form("SSN") & "'" If _ (Request.form("PageDate")) = "1/30/2007" And "h" < "12" _ Then _ sql_update = "Update CWCT07 Set Jan30AM = '" & Request.Form("hdDate") & "' where ssn = '" & Request.form("ssn") & "'" _ Else If _ (Request.form("PageDate")) = "1/30/2007" And "h" > "12" _ Then _ sql_update = "Update CWCT07 Set Jan30PM = '" & Request.Form("hdDate") & "' where ssn = '" & Request.form("ssn") & "'" _ Else If _ (Request.form("PageDate")) = "2/05/2007" And "h" < "12" _ Then _ sql_update = "Update CWCT07 Set Feb02AM = '" & Request.Form("hdDate") & "' where ssn = '" & Request.form("ssn") & "'" _ Else _ response.write(DATE()) _ End If
I get the correct answer:
1/30/2007 7:49:19 AM
But it is going into the Jan30PM column, not the Jan30AM Column. Shouldn't it be reading 7 as less than 12? Is there anyway to parse for the AM/PM part of the Date Function??
Thanks
•
•
Join Date: Jan 2007
Posts: 10
Reputation:
Rep Power: 2
Solved Threads: 0
Thanks. That works. 
Now I just need to make sure the time is a 24 hour clock....not AM/PM?

Now I just need to make sure the time is a 24 hour clock....not AM/PM?
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
- strange behavior:windows xp creating a new same named folder that has exe extension. (Windows NT / 2000 / XP / 2003)
- Open In New Window Php (PHP)
- ASP Date Function (ASP)
- Validate the input date by comparing it with current year using Date function Date(Y) (PHP)
- dateadd function (JSP)
Other Threads in the ASP Forum
- Previous Thread: Upgrade from IIS 5 to IIS 6 issues
- Next Thread: Sort multidimensional array on more than one column?


Linear Mode