Viewing 15 posts - 46 through 60 (of 81 total)
try this...
cast( cast(@NEXT_YEAR as char(4)) + '-07-01' as smalldatetime)
if you make the date up using a region specific date format then it could go wrong at some point.
jon
September 23, 2004 at 12:19 pm
ok - you probably want the sum on your ordered amount on the result of the group by...
select code as ordercode, sum(ordered_amt) as total_amount_ordered, sum(assigned_amt) as total_amount_assigned
from(
select o.code, d.productcode, d.amount as...
August 10, 2004 at 3:51 am
In that scenario, I'd suggest that an identity field may be making your life harder than it needs to be.
You could have a unique sys ref (maybe an identity) and a...
August 10, 2004 at 3:45 am
think you didn't mean to sum by amount.?..
select o.code, d.productcode, d.amount, sum(a.amount)
from orders o
join details d
on d.orders_id = o.orders_id
join assigned a
on a.details_id = d.details_id
group by o.code, d.productcode, d.amount
jon
August 10, 2004 at 3:10 am
You could put everything you want into the select and arrange for the attributes you don't want to be null on some criteria - then they won't appear in...
July 30, 2004 at 3:05 am
Tried it with the same result - also tried on some code we've been using loads (with no problems, fingers crossed ) and that...
July 22, 2004 at 1:52 am
whew - only 5 mins to open this page! sites a bit slow for me at the mo
you can use the format-number function...
July 16, 2004 at 3:53 am
you could try using locking hints (see Locking Hints in BOL) to stop anything else from accessing the batch table while your transaction is going on, though if a lot...
July 15, 2004 at 11:33 am
You're not going to be able to reference MonthsOfStock in the above example because as far as the case statement is concerned it doesn't exist - you could put the...
July 15, 2004 at 10:55 am
I'd guess you've not got ordinary quotes from Word - it does tend to use different characters and put in fancy quotes (single and double) rather than normal ones.
Can't think...
July 15, 2004 at 10:46 am
Sounds like the kind of situation where you want to do a subquery early on with the select distinct in it - to basically build an index/limit of the participants you...
July 15, 2004 at 4:20 am
depends what's in you 2 tables
assuming there's only one row in tblParticipant for each participant then you'll only get multiple rows if there's a one to many relationship with tblDonorMailFlag.
From...
July 15, 2004 at 3:28 am
you should be able to declare a temp table or table variable and insert the results into that, then use your cursor against the table of results
eg
DECLARE @tbl TABLE (..........)
INSERT...
July 13, 2004 at 6:41 am
maybe something along these lines...
declare @d1 datetime
declare @d2 datetime
set @d1 = '2004-05-01 06:40.000'
set @d2 = '2004-05-02 10:00.000'
select cast( datediff(d, @d1, @d2) as varchar(10))
+ ' days and ' +
cast( (datediff(hh, @d1, @d2)%24)...
July 13, 2004 at 6:27 am
yep, it's just multiply all the row counts
don't the users notice that their results don't make sense (I'm assuming they don't)? actually, don't answer...
June 18, 2004 at 1:29 am
Viewing 15 posts - 46 through 60 (of 81 total)