Viewing 12 posts - 1 through 12 (of 12 total)
Thank you all for your replies!
Sorry if I wasn't clear enough. Although the data I populated the Transfer table with spans a whole month, the desired results table I provided...
November 21, 2022 at 9:59 am
The cars are not directly associated with any invoice.
Some invoices (CostCenterAssigned=True) are associated with one ore more Cost Centers and some invoices (CostCenterAssigned=False) are not. The value of those that...
May 29, 2021 at 5:53 pm
The connection between Cars and Invoices is based on CostCenter column (this was CarLocation in Cars table, but I renamed it to CostCenter also to make more sense). I modified...
May 29, 2021 at 11:04 am
Looks like I'll have to migrate to a newer version of SQL. Thank you everyone for their support!
December 8, 2020 at 8:48 am
I tried using your function but in the function comments it says:
1. This code works for SQL Server 2008 and up.
Msg 156, Level 15,...
December 7, 2020 at 5:14 pm
Thank you, Jeff for taking the time to write and comment your response.
However, I get the following error when I run the script:
Msg 208, Level 16, State...
December 7, 2020 at 4:50 pm
Thank you, Jeff for taking the time to respond to my question and I'm sorry for my lack of how-to-post knowledge.
I usually don't post stuff and ask for advice.
I like...
December 5, 2020 at 8:53 pm
By the way, I'm using SQL Server 2005.
I've modified my script as suggested by pietlinden:
WITH D AS (
SELECT CONVERT(VARCHAR, '2020.11.01', 102) AS d_y_m,
CAST('2020-11-01' AS DATETIME) AS dt
UNION...
December 5, 2020 at 9:57 am
I've managed to add the following line to the script:
number = ROW_NUMBER() OVER (ORDER BY x.d_y_m)
So, now I have something to order it by.
But I can't get it to do...
December 4, 2020 at 8:22 am
I don't have the column 'Cashflow' in may tables, is what I want to calculate. As ScottPletcher said, I need a running total.
December 4, 2020 at 7:26 am
Thank you, all, for your answers. Sorry, I posted in a hurry without much details.
So far, I have the following query:
WITH D AS (
SELECT CONVERT(VARCHAR, '2020.11.01', 102) AS d_y_m,
CAST('2020-11-01' AS...
December 3, 2020 at 7:31 pm
Hello,
Thank you all for your replies!
My progress so far:
DECLARE @Driver varchar(50),@StartDt datetime, @EndDt datetime
SELECT @Driver = 'John Doe',@StartDt = '20130101' ,@EndDt = '20130501'
;With VehicleAllocation
AS
(
SELECT h.*,h1.ChangeDate
FROM History h
OUTER APPLY (SELECT MIN(ReceivedDate)...
November 28, 2013 at 12:41 am
Viewing 12 posts - 1 through 12 (of 12 total)