Solved

ASP.net SQL table data types

Posted on 2011-03-01
6
267 Views
Last Modified: 2012-05-11
Hi

I have a SQL table in my ASP project as shown in the image below. I am a little concerned
about the [Start date] and [Start time] column. If I query the table the [Start date] comes up with
the date and the time. How do I change it so it just shows the date table
0
Comment
Question by:murbro
6 Comments
 
LVL 5

Expert Comment

by:sindhuxyz
ID: 35006076
SELECT convert(varchar, getdate(), 103) – dd/mm/yyyy

Here are more formats that can help u more

http://anubhavg.wordpress.com/2009/06/11/how-to-format-datetime-date-in-sql-server-2005/
0
 
LVL 22

Expert Comment

by:Om Prakash
ID: 35006095
0
 
LVL 10

Expert Comment

by:Asim Nazir
ID: 35006285
If you are using SQLServer 2008 then it has Just Date datatype. So you can use that...
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 2

Accepted Solution

by:
DJFuller earned 250 total points
ID: 35007737
Can you not add formatting to the front end of the asp.net to format so it just shows the date. Like using a label control with {0:d} format string?
0
 
LVL 8

Assisted Solution

by:Anurag Agarwal
Anurag Agarwal earned 250 total points
ID: 35007844
SELECT CONVERT(VARCHAR(10), GETDATE(), 101) AS startdate

--  [MM/DD/YYYY]  for date format for reference
0
 

Author Closing Comment

by:murbro
ID: 35008922
Thanks very much
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question