Viewing 15 posts - 571 through 585 (of 3,543 total)
Your conditions look wrong, you cannot have a date that equals today and is less than 30 days ago!
You can use sum and iif in an expression to count rows,...
February 2, 2015 at 2:25 am
marksquall (1/29/2015)
Then on the left side there is a choice to Sort By, it is a drop down button in which you could choose your field named [date_ordered].
date_ordered is a...
February 2, 2015 at 1:20 am
dwain.c (1/28/2015)
David - that's a very clever alternative!
Thank you :blush:
It is very annoying that you can use ALTER COLUMN to do everything except add or remove IDENTITY 🙁
January 29, 2015 at 2:00 am
Change your T-SQL
ORDER BY CAST(date_ordered as date) DESC
(or cast to datetime of pre 2005)
January 28, 2015 at 7:21 am
If the table only contains the 50 rows you inserted or you want to reset all the ID values
ALTER TABLE DROP COLUMN ID
GO
ALTER TABLE ADD ID int IDENTITY(1,1)...
January 28, 2015 at 7:13 am
Jeff Moden (1/27/2015)
David Burrows (1/26/2015)
Please clarify
You are auditing 'what was' and not 'what is'
'Insert' is the first audit row or the main row if no audit exists
and...
January 28, 2015 at 3:13 am
As already pointed out your logic is flawed
e.g. One interpretation of the flawed logic is to find all combinations of VALUEA in both tables where they do not match
SELECT TABLEAVALUEA,TABLEBVALUEA,TABLEBVALUE
FROM...
January 27, 2015 at 6:50 am
I think this a case for using 'FOR XML' to concatenate the last two columns,
however we will need the table DDL and insert statements to create the data in...
January 26, 2015 at 7:42 am
LEFT(Postcode,PATINDEX('%[^A-Za-z]%',Postcode+'0')-1)
January 26, 2015 at 7:30 am
Koen Verbeeck (1/26/2015)
GilaMonster (1/26/2015)
Sean Lange (1/26/2015)
Jack Corbett (1/26/2015)
Sean Lange (1/23/2015)
January 26, 2015 at 7:16 am
Well done Jeff 🙂
Please clarify
You are auditing 'what was' and not 'what is'
'Insert' is the first audit row or the main row if no audit exists
and this needs to be...
January 26, 2015 at 1:52 am
WITH cte1 (CustomerID,MonthID,RSCID,Flag1,Flag2,Flag3)
AS (
SELECTd.CustomerID,d.MonthID,d.RSCID,d.Flag1,d.Flag2,d.Flag3
FROMMyData d
UNION ALL
SELECTd.CustomerID,d.MonthID-n.N,d.RSCID,d.Flag1,d.Flag2,d.Flag3
FROMMyData d
CROSS JOIN (SELECT 1 AS [N] UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4) n
WHEREd.MonthID = 309
),
cte2 (CustomerID,MonthID,RSCID,Flag1,Flag2,Flag3)
AS (
SELECTd.CustomerID,d.MonthID,d.RSCID,d.Flag1,d.Flag2,d.Flag3
FROMcte1 d
UNION...
January 23, 2015 at 2:44 am
I'm on 2008R2 and I set my project properties for Debug/Release configurations for dev and prod respectively.
When I want to deploy I select Build/Configuration Manager from the menu and select...
January 19, 2015 at 6:43 am
SELECT
I.ITEM_ID as ITEM_ID
, IP_NAME.PROPERTY_STRING AS 'WL'
, IP_ACTIVE.PROPERTY_STRING AS 'ACTIVE'
FROM DB1.dbo.ITEM I
INNER JOIN DATE_INFO DI
ON DI.DATETIME = CAST(FLOOR(CAST(GETDATE() AS FLOAT)) AS DATETIME)
AND DI.DATE_TYPE = 'D'
LEFT OUTER JOIN ITEM_PROPERTY IP_NAME
ON IP_NAME.ITEM_ID...
December 18, 2014 at 9:27 am
Viewing 15 posts - 571 through 585 (of 3,543 total)