Formatting problem with retrieving a GETDATE field

Results 1 to 2 of 2

Thread: Formatting problem with retrieving a GETDATE field

  1. #1
    Deftone Guest

    Default Formatting problem with retrieving a GETDATE field

    Hi, I&#039ve got an asp that connects to a SQL Database. <BR><BR>I have a field in the database called subDate which is initialized with the GETDATE() function<BR><BR>When I type "SELECT subDate from DATABASE", I get a listing like: <BR><BR>...<BR>Aug 9, 1999 9:06AM <BR><BR>But if I run that same query through my ASP page, I get <BR><BR>...<BR>8/9/1999 9:06:02 AM <BR><BR>Anyone know why that is? How do I get the date to display as "Aug 9, 1999 9:06AM" in the ASP page? <BR><BR>Thanks,

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Formatting problem with retrieving a GETDATE f

    ASP formats the date variable to a format it likes. Stupid ASP! :) To have complete control over your date formatting statement, you can use the following little script:<BR><BR>Dan&#039s Date Formatting Procedure<BR>http://www.4guysfromrolla.com/webtech/112098-2.shtml<BR><BR>It&#039s pretty easy to use, and very powerful. You can format dates however you need to! :)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •