Viewing 15 posts - 3,106 through 3,120 (of 3,480 total)
Struggling to write a Iif or Switch statement in the expression for the following:
If the cell value is "Y" then nothing
If TODAY() is 10 day or less prior to SV3...
March 7, 2014 at 10:03 pm
You need CHARINDEX() to find the position of the second dash (if it exists).
This almost works:
use tempdb;
go
SELECT OrderNo
, CHARINDEX('-',OrderNo,4) AS FindDash
, LEFT(OrderNo,CHARINDEX('-',OrderNo,4)) AS NoSuffix
FROM (
SELECT 'SO-123456' AS OrderNo
UNION ALL
SELECT 'SO-123456-01'
UNION...
March 5, 2014 at 1:31 pm
If you can avoid using UNION, I probably would. (Maybe SQL Server acts different than it's stepbrother Access, where union query performance was appalling, but I don't know.)
Are you querying...
March 4, 2014 at 12:30 am
What options did you choose when you installed SSRS? "Install but do not configure"? If you did a default install, the install script should have created a ReportServer database....
March 3, 2014 at 9:30 pm
How about...
SELECT ClientID
--,MAX(ServiceDate) AS LastSvcDate
FROM #Services
GROUP BY ClientID
HAVING MAX(ServiceDate)<DATEADD(d,-80,GETDATE());
Then just join that back to the Client table to get the client info...
March 3, 2014 at 12:37 pm
Either mail merge to Word and create mailing labels or create a report in SSRS and do the same thing.
March 3, 2014 at 11:33 am
Getting warmer, but it seems you should read this before posting:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
I'm not trying to be difficult, but it's really hard to recreate something like your situation without it. Could...
March 2, 2014 at 9:36 pm
if the date in 'field B' is less then TODAY() then format the 'field B' as Background Color Red and Font color White,
if the date in 'field B' is equal...
March 1, 2014 at 7:21 pm
Are you using AdventureWorks as your model? Or if not, please post T-SQL to create tables and add some sample data and expected results. Apologies if I'm slow,...
March 1, 2014 at 5:26 pm
join to a table-valued function using CROSS APPLY?
February 25, 2014 at 8:12 pm
Sounds like you're doing what i used to do - summarizing unnormalized healthcare/oncology data. If you can either normalize your underlying tables or create a stored procedure or view...
February 23, 2014 at 1:13 pm
Google is your friend.
If you're looking for something like interview answers, an interview like that will eat you alive unless you know the stuff cold. Any DBA worth his...
February 22, 2014 at 8:29 pm
SELECTDate_Month
, LEFT(Date_Month,3) AS Mo3
, CAST(RIGHT(Date_Month,4) AS INT) AS Yr
, CAST(LEFT(Date_Month,3) + ' 1, ' + RIGHT(Date_Month,4) AS DATE) AS DateFun
FROM (
SELECT 'APR 2012' AS Date_Month
UNION ALL
SELECT 'JAN 2012'
UNION...
February 22, 2014 at 1:55 pm
Two options:
Create another query based on the summary query and the original table. include the column from the original table that you couldn't use in the summary query.
Or
Build...
February 21, 2014 at 4:02 pm
Maybe something like this?
SELECT fileName
, RecID
, page_follow
, rn
, PrevID
, RecID-PrevID AS GapSize
FROM
(SELECT [file_name] AS fileName
, [id] AS RecID
, page_follow
, ROW_NUMBER() OVER (ORDER BY [id]) AS rn
, MAX([id]) OVER (PARTITION BY...
February 21, 2014 at 7:46 am
Viewing 15 posts - 3,106 through 3,120 (of 3,480 total)