Viewing 15 posts - 3,706 through 3,720 (of 4,085 total)
Garadin (6/17/2011)
Here's one way. This is assuming that ItemName can uniquely identify the items.
The fact that he's COPYING the records including the ItemName guarantees that the ItemName cannot uniquely...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 17, 2011 at 8:31 am
Phil Parkin (6/17/2011)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 17, 2011 at 8:11 am
You're very long if structure can be replaced with a simple formula.
SELECT DateAdd(Week, DateDiff(Week, 0, GetDate()), 0)
The formula takes advantage of the fact that date 0 fell on a Monday.
The...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 15, 2011 at 7:52 am
A couple of things that I wanted to point out.
* You use this formula repeatedly in your query DATEADD(MINUTE,-@interval,DATEADD(MINUTE,N*@interval,@starttime)) I moved it into the CTE so that I...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 14, 2011 at 1:39 pm
bpmosullivan (6/14/2011)
WITH CTE AS (
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 14, 2011 at 10:09 am
It's not clear what order you want to apply your criteria, and it will affect the exact query used.
When you have multiple records, do you want to find the last...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 10, 2011 at 2:45 pm
This came up in another thread recently, but I can't find it right now.
If it requires user interaction, it really belongs in the front end. Triggers are about as...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 9, 2011 at 8:53 am
There are far deeper problems with the trigger than the multiple subselects.
If you are only inserting one record, this trigger does ABSOLUTELY NOTHING. If you update column A in...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 9, 2011 at 7:44 am
SKYBVI (6/8/2011)
The index key columns areattribgroup asc char (21)
itemattrib asc char (21)
seqnumber asc int
Are these columns NULLABLE? Do they have DEFAULTs?...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 8, 2011 at 3:08 pm
npeters 86796 (6/7/2011)
the problem i have is that i need to query data using the month in the where clause...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 7, 2011 at 9:13 pm
Did you change this in the main query or the subquery? Changing this in the subquery won't have any real effect on the outcome.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 7, 2011 at 2:35 pm
The last parameter in SUBSTRING() is number of characters, not the ending position. If the length of the string is 30, you're asking for 28 characters from an 8...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 7, 2011 at 1:45 pm
You probably have duplicate values in your IV00101 table, so even though they don't exist in your target table, they produce duplicate values when they are both inserted. Try...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 7, 2011 at 11:50 am
m_cg (6/7/2011)
Still not sure of the format, but gave it 2 ways. Does this work for you?[...]
insert into monthcounter(monthid)
values
(1),
(2),
(3),
(4),
(5),
(6),
(7),
(8),
(9),
(10),
(11),
(12)
Since this syntax was introduced in SQL 2008 and this is a...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 7, 2011 at 10:00 am
The problem here is that the tax week uses modulo arithmetic and the comparison operators don't. So when the tax week reaches 52 (or 53) it cycles back to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
June 7, 2011 at 7:47 am
Viewing 15 posts - 3,706 through 3,720 (of 4,085 total)