Date and Time query

P

Paul Evans

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
 
S

Shawn

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
 

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

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top