467,211 Members | 1,208 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

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

Date and Time query

Hi,

I have created a datagrid which works just fine. One of the columns
retrieves the date which particular row was populated. However, the format
which the date is returned is:

19.12.2004 13:03:25

I only want to display the date that the row was populated, not the exact
time as well. Is there anyway I can do this, or is it an SQL problem when I
first created the table? I'm using a microsoft SQL server. The date is
generated automatically when a row is added to the table.

Thanks for your time

Paul Evans
Nov 19 '05 #1
  • viewed: 975
Share:
1 Reply
Is the date comming from a date field in your DB?
In that case you can format the date in your sql select statement.
Another method is to get the date for each row in ItemDataBound. Get the
date from you label/textbox and put it into a date variable, then save the
value back to the label/textbox using the method you want your date
diplayed. yourDateVariable.ToString("dd.MM.yyyy")

Hope this helps.
Shawn

"Paul Evans" <pa*********@btinternet.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

I have created a datagrid which works just fine. One of the columns
retrieves the date which particular row was populated. However, the format which the date is returned is:

19.12.2004 13:03:25

I only want to display the date that the row was populated, not the exact
time as well. Is there anyway I can do this, or is it an SQL problem when I first created the table? I'm using a microsoft SQL server. The date is
generated automatically when a row is added to the table.

Thanks for your time

Paul Evans

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by vnl | last post: by
1 post views Thread by Thomas Bartkus | last post: by
5 posts views Thread by Javier | last post: by
10 posts views Thread by Kenneth | last post: by
7 posts views Thread by Nicolae Fieraru | last post: by
3 posts views Thread by manning_news@hotmail.com | last post: by
2 posts views Thread by Keith | last post: by
7 posts views Thread by Jerome | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.