date and time

  • Thread starter Thread starter Trond
  • Start date Start date
T

Trond

I have a column in a datafrid where "Last run time" is a integer. THe
integer is retrieved from SQL server 2000 and is like this: 145600. That
means 14:56:00
Same with date: 20050330 means 30 mars 2005. How can i convert those in the
datagrid so that they shows 14:56:00 and 30.03.2005?
Best regards
Trond
 
You can loop through your dataset before you bind to grid and change the
values:

DateToChange = dr("Date") 'row from your dataset

DayValue = Right(DateToChange, 2)
MonthValue = SubString((DateToChange, 5, 2)
YearValue = Left(DateToChange, 4)

dr("Date") = DayValue & "/" & MonthValue & "/" & YearValue

I think that is what you want.

regards,

KS
 
Back
Top