Viewing 15 posts - 601 through 615 (of 1,419 total)
For comparison purposes the date and time columns could be combined in a virtual table ('conv') into datetime columns. Then maybe 3 separate CASE statements so as not to overlap...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 31, 2021 at 7:43 pm
He didn't check with you first before writing the article? Is it because money and smallmoney are really bigint and int? I'm pretty sure major payment API's like Stripe uses...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 31, 2021 at 1:51 am
Here's one by Phil Factor on red-gate.com
Avoid use of the MONEY and SMALLMONEY datatypes (BP022)
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 30, 2021 at 10:43 pm
What about an open source SQL Server project to create a generic forum with no dependencies on UI and which allows for a 3rd party OAuth 2 identity provider? The...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 30, 2021 at 3:21 pm
Imo a type conversion to an approximate data type and a comparison to 0 are not strictly what the question asked. As you know well float and money data types...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 30, 2021 at 2:44 pm
All right Sergiy's correct about the CROSS APPLY's not being necessary. What I don't agree with is using MONEY (VARCHAR converts to FLOAT too fwiw) and comparing the sum to...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 30, 2021 at 11:16 am
On second thought, instead of individually calculating the decimal costs they could be added all together into one value 'dCost'. Also, a combination of TRY_CAST and ISNULL could be used...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 29, 2021 at 8:22 pm
The obligatory comment is regarding the problems arising from storing numeric data as varchar instead of decimal(#, #). Assuming you're stuck with the DDL you could try something like this. ...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 29, 2021 at 1:00 pm
It appears you're looking for $137,000 less the running total of yearly license costs. Also, the 'money' data type is imprecise and has serious issues so this uses decimal(14, 2)...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 25, 2021 at 7:23 pm
Simplified using OUTER APPLY instead of the LEFT JOIN
with
max_min_cte(t_min_dt, t_max_dt) as (
select min(dateadd(hour, datediff(hour, 0, start_dt), 0)),
...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 20, 2021 at 6:02 pm
This uses a tally function (or it could be called a "numbers function") twice. Once, to generate the total hourly datetime range across all rows in table #t. Second, to...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 20, 2021 at 5:30 pm
select *, dateadd(hour, datediff(hour, 0, in_datetime), 0) out_datetime
from #data;
[EDIT] Same answer as Ant-Green but 2 minutes later 🙂
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 20, 2021 at 12:25 pm
select left(isnull(stuff(first_name, 11, 3, '...'), first_name), 13)
from @t1;
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 19, 2021 at 10:40 am
Another alternative could be CROSS APPLY
update t
set AmountAll = ca.sum_amount
from #test t
cross apply (select sum(tt.Amount)
...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 18, 2021 at 11:45 am
As long as people are sharing their CSV secrets. Warning disclosure this contains C# code. A couple of years ago I worked on a project for a fitness tracking system...
Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können
August 16, 2021 at 7:47 pm
Viewing 15 posts - 601 through 615 (of 1,419 total)