469,267 Members | 1,114 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,267 developers. It's quick & easy.

Computed Column

Hello, I have created a computed column which concatenates a name and date.
My problem is that if the 10 is not 10 characters, I get an extra character
placed into the computed column. Here is the code that I have for the
expersion of the computed column...

dtCompetition.Columns["CompetitionNameDate"].Expression= ("trim
(CompetitionName) + ' ' + substring(convert
(EventStartDate,System.String),1,10)");
So if the date being presented is "4/4/2004" I get "4/4/2004 1". If i
change the instruction to only extract 9 characters, then it lops off the
year when the date is 10 characters.

EventStartDate is define as a dateTime variable, so if I just concatenate,
I get a the time information presented, which I do not want.

Is there some way to get around this problem?
Nov 15 '05 #1
0 1468

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Paulo Andre Ortega Ribeiro | last post: by
2 posts views Thread by BCR | last post: by
9 posts views Thread by DMAC | last post: by
3 posts views Thread by Raymond Du | last post: by
6 posts views Thread by jim_geissman | last post: by
2 posts views Thread by Dot Net Daddy | last post: by
7 posts views Thread by Aamir Mahmood | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.