Viewing 15 posts - 1,231 through 1,245 (of 2,647 total)
Sean Lange (4/3/2012)
I think you mean ASCII not ANSI???
What Sean is saying here is that ANSI is not a results type, it is a standard. ASCII is a character set.
April 3, 2012 at 2:22 pm
Ok... Add a UNION ALL between the 13th and 14th SELECT statements 😉
April 3, 2012 at 2:16 pm
Please post the query. See how to do this appropriately in my signature; the article by Jeff Moden.
April 3, 2012 at 2:05 pm
lukebaker (4/3/2012)
I'm using visual studio 2010 with sql server 2008 express this might be why??
It is certainly a reason why your results do not coincide with SQL Server, but it...
April 3, 2012 at 2:03 pm
Integration is manipulating or moving data. I expect that the interviewer was asking if you have experience in SQL Server Integration Services (SSIS). If you do not know what...
April 3, 2012 at 1:58 pm
Well, I ran the query that gave you incorrect results above and I get the right results. So, the problem is not the query, it is your data formatting...
April 3, 2012 at 1:52 pm
How are you getting these results? These are not SQL results, they are formatted... Where are you running your query?
April 3, 2012 at 1:41 pm
Run this and post the results:
SELECT TOP 10 expiry_date, DATEADD(d,1,expiry_date)
FROM v_stafftrainingDetails
and this:
SELECT GETDATE()
April 3, 2012 at 1:29 pm
Try this:
SELECT *
FROM #v_staffTrainingDetails
WHERE expiry_date >= DATEADD(d, 0, DATEDIFF(d,0,GETDATE()))
AND expiry_date < = DATEADD(mm, 2, DATEADD(d, 0, DATEDIFF(d,0,GETDATE())))
April 3, 2012 at 11:59 am
lukebaker (4/3/2012)
April 3, 2012 at 11:52 am
Let's start by going back... How do you define 2 months back? Beginning of month? 60 days? Please gice some sample dates and desired results for dates inside and...
April 3, 2012 at 11:42 am
lukebaker (4/3/2012)
SELECT training_No, training_Type, completed_Date, expiry_Date, qualified_Unqualified, first_Name, last_Name, staff_No
FROM ...
April 3, 2012 at 11:37 am
The reason that Anders' solution is better is because you are not running the DATEDIFF function on each row, but instead running it once on getdate() and then comparing that...
April 3, 2012 at 11:33 am
That really depends on the type of data, transaction load, and many other factors. It also depends on what your definition of "serious overhead" is. Can you build...
April 3, 2012 at 10:40 am
Please provide DDL for the responsible tables and sample data with the DML to populate it. Please reference the article in my signature below.
To get a jump on this, though,...
April 3, 2012 at 10:38 am
Viewing 15 posts - 1,231 through 1,245 (of 2,647 total)