Try Again: add column colB to a dataset and copy values from colA to ColB ?

J

JDP@Work

I have a single datagrid in a usercontrol for my web app. The usercontrol grid
is used in some 10 pages, for viewing and selecting records, searching etc.....

I want to enable date sorting, so I want to take my EventDate comlumn, "ondate"
and copy it's contents to a "SortDate" column, however I would also like to
change the format of the data.

Ondate #02/18/2005#

SortDate string or integer value 20050218

(Will this sort as expected?)

I've gottine this far...

ds.tables(0).columns.Add("SortDate", gettype(string))

But I'm stuck as to how to copy the ondate column and reformat as indicated
above.

TIA

JeffP......
 
J

JDP@Work

Found a simple solution, cast my date as date in my sProc.

select cast(convert(varchar(10),mydate,110)as datetime)

TTA

JeffP....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top