Viewing 15 posts - 331 through 345 (of 623 total)
Thanks. This is resolved and the world has been spared a bit of duplicative data entry.
May 15, 2012 at 8:14 am
How can I incorporate this into a query?
CREATE TABLE #MyCalendar
(
YearMonth char(6),
BinaryCode int
)
INSERT INTO #MyCalendar VALUES ('201205',235673648)
CREATE TABLE #MyData
(
MyDate datetime,
MyData int
)
INSERT INTO #MyData VALUES ('5/1/2012',1)
INSERT INTO #MyData VALUES ('5/5/2012',5)
INSERT INTO #MyData...
May 14, 2012 at 3:16 pm
Brilliant Mr. Miller you are exactly right.
May 14, 2012 at 2:20 pm
I am trying to walk some kind of line here between describing an issue in general and providing exact DDL. The vendor doesn't support direct database access, they allow it...
May 14, 2012 at 9:38 am
Typically a lookup table like EmploymentStatus will allow your application to populate a related field table in your Employees table.
In one scenario the description from the lookup table ('Full-Time') would...
May 13, 2012 at 9:42 pm
Jeff Moden (5/13/2012)
If you know the table name, why not just list the first 60 rows of data and the DDL to start with?
I have concerns about contractual vendor agreements.
May 13, 2012 at 6:21 pm
You should look at the SQL Server logs as well as the server level logs.
Whats the OS?
May 9, 2012 at 1:44 pm
It seems IF ELSE can't be used in a function hence the UNION ALL technique. Any way to not call the function 4 times? Or is the performance implication so...
May 7, 2012 at 4:43 pm
Thanks! Looks good from the testing I have done.
DECLARE @Period VARCHAR(50)
DECLARE @TestDate datetime
--SET @Period = 'MostRecentYearToDate'
SET @Period = 'MostRecentCompletedYear'
--SET @Period = 'MostRecentThreeMonthPeriod'
--SET @Period = 'MostRecentCompleteQuarter'
--SET @TestDate...
May 7, 2012 at 4:29 pm
Period,Start_Date,End_Date
MostRecentYearToDate,2011-12-31,2012-04-30
MostRecentCompletedYear,2011-04-30,2012-04-30
MostRecentThreeMonthPeriod,2012-01-31,2012-04-30
MostRecentCompleteQuarter,2011-12-31,2012-03-31
Both start and end date should always be the last day of the month.
The function as I posted it 'seems' to be working except for the start date for MostRecentThreeMonthPeriod.
May 7, 2012 at 4:07 pm
It sounds like you want to use the MERGE command.
If you search for MERGE TSQL you will find lots of examples.
May 7, 2012 at 1:24 pm
I think you need a full self-join.
Since you did not provide DDL here is some air code....
SELECT
1.Date AS Tag1Date,
1.Value AS Tag1Value,
2.Date AS Tag2Date,
2.Value AS Tag2Value
FROM YourTable 1
FULL JOIN...
May 2, 2012 at 2:06 pm
Conceptually you want to do something like
SELECT
*
FROM YourTable
WHERE YOUR ClientCode IS NOT IN
(
SELECT ClientCode FROM YourTable WHERE PostedDate > DATEADD(yy,-1,getdate())
)
The MAX statement should give similar results. I...
May 2, 2012 at 1:27 pm
The code maintenance I was referring to is a stored procedure, server side, not client side.
I need the sorting server side since I am using the top keyword. My client...
April 25, 2012 at 9:31 am
The trade off I was referring to would be in code maintenance. Using IF>ELSE I'd have two largely identical blocks of code, one ACS and one DESC. Changes would need...
April 25, 2012 at 8:39 am
Viewing 15 posts - 331 through 345 (of 623 total)