asp.net - datagrid and date?

  • Thread starter Thread starter Morten
  • Start date Start date
M

Morten

Hi.

I have a problem getting date coorect in my datagrid.
Date in the database is integer like this 20010614
I create a View and I have tried cast but I can not get passed dd.mm.yyyy
hh:mm:ss
I want the date in the grid to come out as dd.mm.yyyy

Any ideas?

Thanks

Morten
 
Hi,
I would prefer to do the conversion in the backend
Something like this
declare @m int
set @m = 20010605

select cast(substring(cast(@m as varchar(10)),1,4) + '.' +
substring(cast(@m as varchar(10)),4,2)
+ '.' + substring(cast(@m as varchar(10)),8,2) as datetime)

Thanx
Deep
 
Thanks Deepankar


Deepankar said:
Hi,
I would prefer to do the conversion in the backend
Something like this
declare @m int
set @m = 20010605

select cast(substring(cast(@m as varchar(10)),1,4) + '.' +
substring(cast(@m as varchar(10)),4,2)
+ '.' + substring(cast(@m as varchar(10)),8,2) as datetime)

Thanx
Deep
 
Back
Top