Viewing 15 posts - 4,876 through 4,890 (of 8,731 total)
It's easy to identify "DD-MM-YYYY" and "MM-DD-YYYY" from "YYYY-MM-DD" or "YYYY-DD-MM", as long as you always use dashes or slashes. The problem comes to differentiating months against days when...
May 28, 2015 at 10:21 am
I'm not sure about this, but the cause might have been that a wrong collation was installed when installing SQL Server or creating the database. If you continue to have...
May 28, 2015 at 9:46 am
I hope that you understand that these are 3 examples from which you need to choose one, according to your requirements. Feel free to ask any questions that you have.
Note...
May 28, 2015 at 9:02 am
It seems that you really need a CASE expression. I'm not sure how would you need to use it, so I'm giving you 3 options.
--Creating some sample data
CREATE TABLE #Staging(
...
May 27, 2015 at 4:14 pm
Ed Wagner (5/27/2015)
Alan.B (5/27/2015)
Brandie Tarvin (5/27/2015)
Just curious how many people on The Thread are World Cup fans. Cause... STUFF and MORE STUFF.And I was wondering how y'all felt about it.
I...
May 27, 2015 at 11:38 am
Maybe you're looking for a CASE expression which is used inside a SELECT statement.
Or maybe you need to define the actions used within the IF statements.
May 27, 2015 at 11:35 am
I guess the limitation comes because the development team has no interest on creating additional functionality to PRINT. Why would they?
May 27, 2015 at 10:03 am
What are you trying to do exactly?
If you're pivoting data, I suggest you to read the following article:http://www.sqlservercentral.com/articles/T-SQL/63681/
May 27, 2015 at 9:59 am
There's a couple of choices to do this. I prefer to use cross tabs, while other prefer to use the pivot operator.
Cross-tabs allow more flexibility and might outperform pivot in...
May 27, 2015 at 9:23 am
Sean Lange (5/27/2015)
Brandie Tarvin (5/27/2015)
Just curious how many people on The Thread are World Cup fans. Cause... STUFF and MORE STUFF.And I was wondering how y'all felt about it.
I am...
May 27, 2015 at 8:54 am
The #Output table is populated using the OUTPUT clause in the insert. I included it because is a good option if you're using identity columns from which you might not...
May 26, 2015 at 12:10 pm
Eric M Russell (5/26/2015)
A simple CAST operation from date/time to date won't necessarily prevent usage of an index on a date/time column. For example, given the following table and index,...
May 26, 2015 at 11:26 am
This might work for you. I'm not sure if we're missing something you left out, so you might need to tweak some things.
BEGIN TRY
BEGIN TRAN
...
May 26, 2015 at 11:18 am
The safe way would be to always manage dates as dates instead of strings.
To safely convert a string into a date, you can use CONVERT (or TRY_CONVERT if available), as...
May 26, 2015 at 10:47 am
itortu (5/26/2015)
SELECT orderno
FROM _order
WHERE CAST(FLOOR(CAST(order_date AS FLOAT)) AS DATETIME)
BETWEEN CAST('5/14/2015' AS DATETIME)
AND CAST('5/15/2015' AS DATETIME)
ORDER BY order_date asc
The date will...
May 26, 2015 at 10:26 am
Viewing 15 posts - 4,876 through 4,890 (of 8,731 total)