View Single Post
  #1 (permalink)  
Old April 17th, 2009, 10:31 PM
chobo2 chobo2 is offline
Friend of Wrox
Points: 782, Level: 10
Points: 782, Level: 10 Points: 782, Level: 10 Points: 782, Level: 10
Activity: 2%
Activity: 2% Activity: 2% Activity: 2%
 
Join Date: Sep 2007
Location: , , .
Posts: 168
Thanks: 7
Thanked 2 Times in 2 Posts
Default Need Help with Convert SQL.

Hi

I am using a typed dataset and I using Convert to try to trim one of my datetimes to just date(I am using mssql2005).

So I have something like this in my sql query.

CONVERT(varchar, ExpiryDate, 101) AS ExpiryDate

Now when I run it in the query builder it trims it down to just the date but when I run it live it still has the time.

I am attaching it to a grdivew. So first I made a bound field:

BoundField endDate = new BoundField();
endDate.HeaderText = "Expiry Date";
endDate.DataField = "ExpiryDate";

Then I return a datatable from my 3 tier architecture and use this as the Datasource and then bind it but I keep getting it with the time included.

Did I do something wrong?
Reply With Quote