format date(s) from sql server

R

rbutch

guys, when using templates like below - this particular one is a date.
are there any properties in the template columns i can access to format the date to show a short.dateString? so it wont show the time 12:00 am

normally with oracle i can to a to_char(my_date,format mask) single row function within the query string. but sql server doesnt have that. or maybe it does and i just havent found it

<asp:TemplateColumn HeaderText="BalDate">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "BalanceDate") %>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox Runat="server" ID="myBalance" Width="4em" ReadOnly="True"
Text='<%# DataBinder.Eval(Container.DataItem, "BalanceDate") %>'>
</asp:TextBox>
</EditItemTemplate>
</asp:TemplateColumn>

thanks for any help on this
rik

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
R

rbutch

thanks Gabe, that put me on the right track. I plugged this into my sproc and it works like a charm. returns the BalanceDate in the mm/dd/yyyy just like i needed.

Convert(varchar,BalanceDate,101)BalanceDate

thanks again
rik



**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 

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

Top