Viewing 15 posts - 3,436 through 3,450 (of 4,087 total)
ALZDBA (12/9/2011)
col >= @begin and col <= @end
SQLServer has an issue with datetime data...
December 9, 2011 at 1:37 pm
There are several possibilities, but without sample data, it's difficult to determine which is best. Here are just two options.
WITH DupeCheck AS (
SELECT id, date, time, location, cardnumber, amount,...
December 9, 2011 at 11:22 am
CELKO (12/9/2011)
@in_start_date AAS report_start_date
@in_end_date AS report_end_date
FROM Calendar AS...
December 9, 2011 at 10:56 am
HowardW (12/9/2011)
December 9, 2011 at 10:13 am
HowardW (12/9/2011)
December 9, 2011 at 9:08 am
JonFox (12/8/2011)
WHERE (H.SALESSTTUS = 1 AND
H.SALESORIGINID IN ('DSM','DSM-Trf') AND
...
December 9, 2011 at 8:34 am
There should be another error message before this one that will give you details about the exact error that occurred. Without that previous error message, we can't really tell...
December 9, 2011 at 7:08 am
Ninja's_RGR'us (12/7/2011)
Cool, and the tested solution is? 😉
I thought that the FOR XML PATH('') solution was probably not the best solution in this particular case, so I didn't test it....
December 7, 2011 at 11:41 am
Ninja's_RGR'us (12/7/2011)
And the solution is??? Those are columns, not rows.
I'll let you think about it for a couple minutes ;-).
FOR XML PATH('') needs to be handle any data that...
December 7, 2011 at 11:05 am
srik.kotte (12/7/2011)
That is not possible actually.I have to do it in T-SQL :(. The requirement is like that.
Why is that the requirement? Is this for a class?
You want to...
December 7, 2011 at 11:00 am
If you are planning to export these, you're better off doing this in SSIS rather than T-SQL. In SSIS, you can specify the delimiter and automatically include headers.
Drew
December 7, 2011 at 10:31 am
Here is a different approach using a CROSS APPLY.
SELECT PetID
, p.PetName
, pd1.DDate AS Date1
, pd2.Date2
FROM @Pet AS p
INNER JOIN @PetDetail AS pd1
ON p.PetID=pd1.PetDetailID
AND pd1.DType = 14
CROSS APPLY (
SELECT TOP (1)...
December 7, 2011 at 10:27 am
I prefer using FOR XML PATH(''), because it
1) automatically handles the conversion
2) automatically handles NULL values
If you're working with character data, you do have to be careful with certain restricted...
December 7, 2011 at 10:00 am
PIVOT is probably not the right tool for the job, because it doesn't provide grand totals. The correct tool depends on exactly how you are using this data. ...
December 7, 2011 at 7:49 am
Cadavre (12/6/2011)
For your own sanity, or that of whoever has to maintain this monster, try this instead: -
I would go even further. For your own sanity, your whole data...
December 6, 2011 at 9:04 am
Viewing 15 posts - 3,436 through 3,450 (of 4,087 total)