Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 24 paź 2014 · I would like to convert a datetime field to varchar so I can show a blank or a message when the date is NULL. This is what I have so far: select isnull(us.Date,0) as USDate, isnull(au.Date,0) as A...

  2. 21 mar 2013 · In this case you can't just set a DATETIME to an empty string. Try it: SELECT CONVERT(DATETIME, ''); One workaround is to present your date as a string: CASE WHEN CONVERT(DATE, CreatedDate) = '1900-01-01' -- to account for accidental time THEN '' ELSE CONVERT(CHAR(10), CreatedDate, 120) + ' ' + CONVERT(CHAR(8), CreatedDate, 108) END

  3. 19 sty 2001 · The solution is in-fact a workaround or a quick fix than a total solution, since a blank date can be either a NULL or 1900-01-01. However, converting the date into a string does relieve us from showing irrelevant data to our clients.

  4. 17 lis 2015 · You can't get an empty string because you're returning the DATE value type from ISNULL. Per the docs, ISNULL. Returns the same type as check_expression. If a literal NULL is provided as check_expression, returns the datatype of the replacement_value.

  5. 1 maj 2012 · Use the FORMAT function to format the date and time data types from a date column (date, datetime, datetime2, smalldatetime, datetimeoffset, etc. data type) in a table or a variable such as GETDATE() To get DD/MM/YYYY use SELECT FORMAT (getdate(), 'dd/MM/yyyy ') as date

  6. 13 lis 2023 · SQL Server provides a number of options you can use for formatting a date/time string in SQL queries and stored procedures either from an input file (Excel, CSV, etc.) or a date column (datetime, datetime2, smalldatetime, etc.) from a table.

  7. 15 cze 2017 · Definition and Usage. The DATE_FORMAT () function formats a date as specified. Syntax. DATE_FORMAT (date, format) Parameter Values. Technical Details. More Examples. Example. Format a date: SELECT DATE_FORMAT ("2017-06-15", "%M %d %Y"); Try it Yourself » Example. Format a date: SELECT DATE_FORMAT ("2017-06-15", "%W %M %e %Y"); Try it Yourself »

  1. Ludzie szukają również