Viewing 15 posts - 1,051 through 1,065 (of 3,500 total)
February 23, 2019 at 1:26 am
Please post the table definitions for the relevant tables. What you're doing sounds way harder than this should be.
February 22, 2019 at 10:39 pm
Isn't it as simple as DIVIDE(COUNTROWS('OrderLineItems'),COUNTROWS('Orders')) ?
February 20, 2019 at 9:11 pm
February 20, 2019 at 2:20 pm
This?SELECT SortOrder, country, colour, amount
, DENSE_RANK() OVER (ORDER BY SortOrder) AS rn
FROM #testing
ORDER BY SortOrder
, Country
, Colour
, Amount
Oh wait,...
February 18, 2019 at 9:09 pm
February 18, 2019 at 5:52 pm
I wouldn't back up the structure to Access. There isn't a perfect 1:1 object mapping between the two. Why not just script out all the objects so you have all...
February 18, 2019 at 5:39 pm
In the below given schema and data, we need to find the time...
February 17, 2019 at 10:29 pm
This returns the first of the current month
SELECT DATEADD(month, DATEDIFF(month, 0, GETDATE()), 0) AS StartOfMonth
So you'd just add months to that.
February 15, 2019 at 4:40 pm
Not sure if this will help at all, but here goes.
Say you create one query that calculates the Numerator (and you include the grouping column you need, so you...
February 15, 2019 at 12:51 pm
In the outermost query (the first SELECT), you'd just do something like
SELECT [Aggregate1] / [Aggregate2]
FROM...
As long as the two values are correct in the source query,...
February 15, 2019 at 11:56 am
What did you try? A DATEDIFF to get an individual record's wait and then sum that?
February 15, 2019 at 6:37 am
Your logic explanation makes me think that maybe you want either ROW_NUMBER() or COUNT() with a windowing function.SELECT ID
, Type
, ROW_NUMBER() OVER (PARTITION BY ID,...
February 14, 2019 at 11:45 am
Maybe Kenneth Fisher's article on CROSS APPLY would help, but without some sample data, it's hard to tell.
February 12, 2019 at 12:00 pm
Something like this?
DECLARE @SearchDate DATE = GETDATE();
INSERT INTO MyTable (col1, col2, col3)
SELECT col2, col2, DATEADD(day,1,@SearchDate)
FROM MyTable
WHERE col3 = @SearchDate;
Here's some actually tested...
February 11, 2019 at 10:02 pm
Viewing 15 posts - 1,051 through 1,065 (of 3,500 total)