Viewing 15 posts - 49,381 through 49,395 (of 49,571 total)
Not for what you're trying to do.
From Books Online:
The DATEADD function adds an interval to a date you specify.
The DATEDIFF function calculates the amount of time in dateparts between...
October 11, 2005 at 6:05 am
Either
SELECT DATEADD(mi,-60,GETDATE())
or
SELECT DATEADD(hh,-1,GETDATE())
First subtracts 60 minutes, second subtracts 1 hour.
HTH
October 11, 2005 at 5:02 am
The structure of your tables and some example data would realy help, but I'll take a shot at it without.
I think you'll find a subquery will help greatly.
SELECT ...
FROM...
October 11, 2005 at 1:05 am
According to relational theory, the phrase 'order of rows in a table' is meaningless.
The fact that, in SQL, a clustered index gives the data a natural sort order is more...
October 11, 2005 at 12:28 am
Adding a column using alter table will always put the column at the end.
Enterprise manager completely recreates the table when you modify the structure, that's why it can add a...
October 10, 2005 at 1:29 am
Hence, since SQL cannot store dates with a finer granularity than 3ms, the day ends at 23:59:59.997
Other times which can be stored correctly include 23:59:59.993 and 23:59:59.990.
October 6, 2005 at 2:03 am
I don't know what decode does, and I don't know exactly what you're trying to do, but have a look at the following and see if it helps.
SELECT job,
sum(CASE...
October 5, 2005 at 6:05 am
Thanks, that's good to know. This is the first time I'm working with xml in SQL. Haven't touched xml since I was doing webdev some years back.
Agreed, name and...
October 5, 2005 at 2:16 am
I posted an example:
<FilterString><Sender /><OurReference /><Reference>PT21 </Reference><Direction /><Type /><Host /></FilterString>
Another example:
<FilterString><Status /><Sender /><Reference /><AccountNo /><DateFrom>2005-09-01</DateFrom><DateTo>2005-09-28</DateTo></FilterString>
It's the way the front end passes an array of parameters to SQL, so the only...
October 4, 2005 at 8:11 am
Can't drop the xml, short of rewriting the entire front end app (which isn't an option) and large portions of the back-end code
Basically (and very simplified), the front-end app calls...
October 4, 2005 at 7:46 am
Server: Msg 157, Level 15, State 1, Line 2
An aggregate may not appear in the set list of an UPDATE statement.
I thought of that first too, but a quick test...
October 4, 2005 at 1:02 am
only 15? I've got 978
Add the roles db_datareader and db_datawriter to the login faelogin. That will automatically grant them rights to read...
October 4, 2005 at 1:01 am
Update POSumTable
set ProductTotal = SumOfAmount,
DiscountTotal = SumOfDiscount,
TaxTotal = SumOfTax
FROM (SELECT POno, sum(b.Productamt) AS SumOfAmount, sum(b.DiscountAmt) AS SumOfDiscount, sum(b.TaxAmount) AS SumOfTax
FROM ItemTable
GROUP BY PONo
) SumOfProducts
WHERE SumOfProducts.POno =...
October 3, 2005 at 12:51 am
If you absolutely must use a cursor (which is completely unnecesary in this case, and in most cases where people use them) then al least dclare it with sensible options.
DECLARE...
September 30, 2005 at 6:22 am
By percentage, do you mean the percentage of records that have 1, 2 or 3 in them? If so, this should work. If not, please post example data and required...
September 30, 2005 at 5:45 am
Viewing 15 posts - 49,381 through 49,395 (of 49,571 total)