Viewing 15 posts - 256 through 270 (of 355 total)
What's the data type of the following columns?
If they are character fields, how are the date strings formatted?
BW1.dbo.qryIntermediate_CIS_BrentEvents.EV_DATE
BW1.dbo.qryIntermediate_CIS_BrentEvents.REF_DATE
Also the following isn't a reliable way of calculating a person's age -...
March 6, 2009 at 9:04 am
I think that you could argue with your "senior programmer" that "a <> b" is more readable and maintanable and is thus the preferable method. A "senior programmer" should understand...
March 6, 2009 at 8:25 am
How about this.
By setting @firstWeekday, the code can be made to work for any day being the first day of the week, or you can set it to @@DATEFIRST for...
March 5, 2009 at 5:45 am
How are you defining the start and end of a week and how are you defining week numbers?
For instance, if your week runs from Sunday to Saturday, if the 1st...
March 5, 2009 at 4:25 am
Doubled single quotes rather than double quotes.
[font="Courier New"]EXECUTE('Select ''A'' as [Test],* From myTable')[/font]
March 3, 2009 at 3:12 pm
You could set the MaximumValue of the top ranked entry in the TblMasterData table to NULL and use the following amended query.
UPDATE C SET C.rank = M.ReputationValue
FROM TblComputedData C...
March 3, 2009 at 4:01 am
UPDATE C
SET C.rank = M.reputationvalue
FROM TblComputedData C INNER JOIN TblFeedbackData F
ON c.userId = F.UserId
INNER JOIN TblMasterData m
ON F.Score BETWEEN m.MinimumValue and M.MaximumValue
WHERE isProcessed =1
There's a potential problem...
March 3, 2009 at 3:26 am
How about this
/* If you are starting from a datetime */
DECLARE @date datetime
SELECT @date = '2009-01-01'
SELECT DATEADD(year, DATEDIFF(year, -1, @date), -1)
/* or */
SELECT DATEADD(year, DATEPART(year, @date) - 1899, -1)
/* or...
March 3, 2009 at 12:34 am
The following works regardless of the value of @@DATEFIRST
DECLARE @today datetime
DECLARE @weekday int
DECLARE @startInterval datetime
DECLARE @endInterval datetime
SELECT
@today = DATEADD(day, DATEDIFF(day, 0, GETDATE()), 0),
@weekday = DATEDIFF(day, 0, @today) % 7,
@startInterval...
March 2, 2009 at 4:51 pm
Does this work?
It's untested.
SELECT
T.bol_no,
T.rev_no,
T.trailer_id,
C.comm_code,
DC.prod_storage_id,
C.comm_um,
DCO.quantity,
C.end_scale_wt,
C.quantity,
extended_weight = (
SELECT multiplier * DCO.quantity
FROM BDS_COMMODITY_UM_CONVERT BCUM
WHERE (BCUM.comm_code =...
February 26, 2009 at 12:54 pm
One quick question.... What's the logic behind the bounding box?
Where Longitude between @Longitude-.1 and @Longitude+.1
And Latitude between @Latitude-.1 and @Latitude+.1
Is that...
February 26, 2009 at 11:38 am
You were previously given sufficient advice that should have enabled you to amend your own query, but I've done it for you here, plus tidied up a few details. I'm...
February 25, 2009 at 6:49 am
There are several other ways of splitting a delimited string, some of which are more efficient than using recursive CTEs.
You could use a Tally table, convert to an XML string...
February 23, 2009 at 2:27 pm
The use of Julian date to refer to the day-of-year (ordinal date) is usually considered to be incorrect...
Quite right - apologies for my sloppy terminology.
February 23, 2009 at 12:40 pm
Given that January 1st is the first ordinal day of a year, the example TSQL scripts above are 1 day out.
If the date and time fields are stored as integers...
February 23, 2009 at 11:41 am
Viewing 15 posts - 256 through 270 (of 355 total)