Getting the date form a DB

Results 1 to 2 of 2

Thread: Getting the date form a DB

  1. #1
    Carlos Minuez Guest

    Default Getting the date form a DB

    I have a date in my SQL Server database in this format XX/XX/XX. I need to get this date out of the DB and put into 3 drop down boxes of Month/Day/Year. Does anyone know how I can accomplish this? I would need for it to be defaulted to the date that was in the DB. Thanks in advance.

  2. #2
    Join Date
    Dec 1969

    Default Getting a Date

    Simple<BR><BR>you can extract the date from the db<BR><BR>in vbs you can use day = DatePart("dd",rs("date"))<BR><BR>then use javascript to set the date,<BR><BR>function setDate(d,m,y,dv,mv,yv)<BR> {<BR> <BR> d.options[dv].selected = true;<BR> m.options[mv].selected = true;<BR> y.value = yv;<BR> }<BR>where d,m,y are the document.formname.formfieldname<BR>and dv,mv,yv are the values from the date.<BR><BR>call from onLoad event handler in body of page.<BR><BR>look into vbscript refernce regarding datepart<BR><BR>you can always extract the day,month,year from sql server in the query select DatePart(d,date) as day.

Posting Permissions

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