Viewing 15 posts - 1,111 through 1,125 (of 3,500 total)
Go back and ask said DBA why he wants this. Sounds absurd. The nice thing about stored procedures is that you can assign rights to them. you can't do that...
January 17, 2019 at 1:43 pm
If you have a Calendar table, this is infinitely easier. You would outer join Calendar to your Trips table and then aggregate on columns in the Calendar table (Year, Month,...
January 15, 2019 at 3:20 pm
You need to calculate the month from the date. A date is just a number...
SELECT MONTH(start_date), COUNT(*) AS Count
FROM trips
WHERE YEAR(start_date) = 2016
GROUP BY MONTH(start_date);
January 15, 2019 at 11:41 am
.What if you automated Excel to write the values somewhere? Assign the values to variables (one for the file name too), and then maybe have a connection to your database...
January 14, 2019 at 8:26 pm
If you add a Calendar table and put the FM, FY in there as columns, then this is trivial.
January 14, 2019 at 2:43 pm
Are you just adjusting for a Fiscal Year or similar? You could do that with a Calendar table.
January 14, 2019 at 1:55 pm
Essentially, you're just checking if the Customer has Instore sales and/or Online sales?
Can't you just do that with IF(COUNTROWS(RELATEDTABLE('Sales'))>1,1,0) and put it in the Customer table? You might need...
January 14, 2019 at 10:52 am
SQL Sat Nashville is tomorrow... if you run fast, you could probably squeeze in a session or two.
January 11, 2019 at 7:46 pm
January 10, 2019 at 7:25 pm
Did you run the code to create the function? Sounds like you didn't.
January 10, 2019 at 7:05 pm
Oh, okay. Thanks! I'll have a play with it and see how I make out.
January 10, 2019 at 1:13 pm
Like this?
https://stackoverflow.com/questions/420741/getting-list-of-tables-and-fields-in-each-in-a-database
I suppose you could easily find non-matching tables by grouping on column name and getting COUNT = 1?
SQLCompare by RedGate does that, I...
January 9, 2019 at 2:26 pm
January 9, 2019 at 12:13 pm
Figured out a small piece of this that was still wrong. I needed to change so that I get the MAX level for each course. Then it makes sense. (Because...
January 9, 2019 at 10:31 am
Here's an example I shamelessly copied out of Itzik Ben-Gan's T-SQL Querying book:SELECT custID, orderID, orderDate, val,
SUM(val) OVER (PARTITION BY custid, YEAR(orderDate)
ORDER BY orderDate
RANGE...
January 7, 2019 at 12:25 pm
Viewing 15 posts - 1,111 through 1,125 (of 3,500 total)