How can i obtain the date only from the datetime column?

user2624315

I have following query

SELECT GETDATE()

which returns me as 2013-11-16 03:31:07.740 I want only the DATE part and omit Time part.

I have used

select convert(varchar, getdate(), 100) convertResult,100 style union
select convert(varchar, getdate(), 101),101 union
select convert(varchar, getdate(), 102),102 union
select convert(varchar, getdate(), 103),103 union
select convert(varchar, getdate(), 104),104 union
select convert(varchar, getdate(), 105),105 union
select convert(varchar, getdate(), 106),106 union
select convert(varchar, getdate(), 107),107 union
select convert(varchar, getdate(), 108),108 union
select convert(varchar, getdate(), 109),109 union
select convert(varchar, getdate(), 110),110 union
select convert(varchar, getdate(), 111),111 union
select convert(varchar, getdate(), 112),112 union
select convert(varchar, getdate(), 113),113 union
select convert(varchar, getdate(), 114),114  union
select convert(varchar, getdate(), 120),120  union
select convert(varchar, getdate(), 121),121  union
select convert(varchar, getdate(), 126),126  union
select convert(varchar, getdate(), 127),127  union
select convert(varchar, getdate(), 130),130  union
select convert(varchar, getdate(), 131),131
order by 2

But not any combination gives me the date section only.

M.Ali
SELECT CONVERT(VARCHAR(10), GETDATE(), 101) 

Returns

11/15/2013

SELECT CONVERT(VARCHAR(10), GETDATE(), 120)

Returns

2013-11-15

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I get only the date and time from the string?

From Dev

How can I obtain all the image pixels from a UIImage object

From Dev

how can I obtain HWND of a class derived from QMainWindow

From Dev

How can I update date of datetime field with mysql only?

From Dev

How can I obtain a file handle from its fileno in Perl?

From Dev

Obtain date column from xts object

From Dev

How can I obtain a CGColor from RGB values?

From Dev

How to get DATE from DATETIME column?

From Dev

how do i use group by only on date from datetime in LINQ query

From Dev

How can I obtain the colnames from part of a sorted matrix column?

From Dev

How can I implode() only one column from a multidimensional array?

From Dev

How can I obtain connectedAndroidTestDebug logcat from commandline gradlew?

From Dev

query a datetime column by date only

From Dev

Spring Data JPA - How can I fetch data from a Date column using only month and day?

From Dev

How can I make it so that the column only calculates data from a certain date?

From Dev

How can I obtain the year quarter from a date?

From Dev

can't get only the date from datetime

From Dev

How can I obtain all the image pixels from a UIImage object

From Dev

how can I obtain HWND of a class derived from QMainWindow

From Dev

How can I obtain the exponent and modulus from a PEM

From Dev

How can I obtain the date and time from a git_time object?

From Dev

How can i have pick only date from datetmepicker in angularjs?

From Dev

Obtain last non empty date from column

From Dev

Obtain Hours only from Datetime Rfacebook package

From Dev

How can I modify this query to obtain only the last record having a field value different from 0?

From Dev

How can I construct an elapsed time column from a column of pandas.datetime64?

From Dev

How can I create a new column for month and year from datetime and logically compare date time in R

From Dev

How can I display datatable datetime column as date in Combo Box when using concatenated string?

From Dev

Select only date from column with datetime format

Related Related

  1. 1

    How can I get only the date and time from the string?

  2. 2

    How can I obtain all the image pixels from a UIImage object

  3. 3

    how can I obtain HWND of a class derived from QMainWindow

  4. 4

    How can I update date of datetime field with mysql only?

  5. 5

    How can I obtain a file handle from its fileno in Perl?

  6. 6

    Obtain date column from xts object

  7. 7

    How can I obtain a CGColor from RGB values?

  8. 8

    How to get DATE from DATETIME column?

  9. 9

    how do i use group by only on date from datetime in LINQ query

  10. 10

    How can I obtain the colnames from part of a sorted matrix column?

  11. 11

    How can I implode() only one column from a multidimensional array?

  12. 12

    How can I obtain connectedAndroidTestDebug logcat from commandline gradlew?

  13. 13

    query a datetime column by date only

  14. 14

    Spring Data JPA - How can I fetch data from a Date column using only month and day?

  15. 15

    How can I make it so that the column only calculates data from a certain date?

  16. 16

    How can I obtain the year quarter from a date?

  17. 17

    can't get only the date from datetime

  18. 18

    How can I obtain all the image pixels from a UIImage object

  19. 19

    how can I obtain HWND of a class derived from QMainWindow

  20. 20

    How can I obtain the exponent and modulus from a PEM

  21. 21

    How can I obtain the date and time from a git_time object?

  22. 22

    How can i have pick only date from datetmepicker in angularjs?

  23. 23

    Obtain last non empty date from column

  24. 24

    Obtain Hours only from Datetime Rfacebook package

  25. 25

    How can I modify this query to obtain only the last record having a field value different from 0?

  26. 26

    How can I construct an elapsed time column from a column of pandas.datetime64?

  27. 27

    How can I create a new column for month and year from datetime and logically compare date time in R

  28. 28

    How can I display datatable datetime column as date in Combo Box when using concatenated string?

  29. 29

    Select only date from column with datetime format

HotTag

Archive