|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
retrieve date from db and use selects to reflect day, month, year seperately
Hi
I have a form which allows a user to select a 'commencement date' using separate day, month and year drop downs. The date is then submitted to db in DDMMYYYY format(as required). I now need to allow user to edit this date if they need to. So, I retrieve the date from db as ie. 30101968. I now need to place the first 2 digits (30) into strDay, second 2 digits into strMonth and last 4 into strYears so that I can reflect these values in the their relevant drop downs. Does anyone know how to 'grab' those specific values? Thanks! Lee |
|
#2
|
|||
|
|||
|
hi leeolive,
you can use the function Mid(string,start[,length]) for your date Code:
dim mydate mydate="30101968" strDay=Mid(mydate,1,2) strMonth=Mid(mydate,3,2) strYear=Mid(mydate,5)
__________________
Hope this helps. Mike Royal Selangor Pewter "I have not failed. I've just found 10,000 ways that won't work." - Thomas Alva Edison (1847-1931) |
|
#3
|
|||
|
|||
|
Thanks, Mike! that would be useful for lots of things.
Appreciate it. Lee |
|
#4
|
|||
|
|||
|
no problem, that's what forums are used for.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > retrieve date from db and use selects to reflect day, month, year seperately |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|