Viewing 15 posts - 57,421 through 57,435 (of 59,101 total)
The way you have it written, you are trying to insert into a temp table and variables at the same time. If you want to do both, you will need...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 8:21 pm
Be aware that when you change a diagram and save it, it actually updates your database to match... diagrams are really a form of somewhat anorexic data models.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 8:16 pm
Another possibility would be to use a "Linked Server" which would also hide the login and password from prying eyes.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 8:14 pm
That's a good start... got any data we can play with and, like I asked, are the tests stored in the same table as the quizzes? If so, what marks...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 4:54 pm
Where is the Test info stored? In the QuizLog?
Sidebar... does you table actually have columns with spaces in the names
?
I think it...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 6:56 am
It sounds like the classic "make change" problem that used to be taught in many programming classes... I'm on my way to work right now but I think a function...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 6:49 am
Perfect case of too many cooks spoiling the broth
Thanks for the feed back on what you found, Ville... definitely something to keep...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 6:42 am
No. Serqiy is correct... the table design is wrong... if you take multiple payments for a given invoice, you should have multiple rows.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 16, 2006 at 6:31 am
Stephen,
If you want separate totals for each payment type, then this would do...
SELECT SUM(Cash) AS TotalCash,
SUM(Cheque) AS TotalCheque,
SUM(CC) AS TotalCC,
SUM(Account) AS TotalAccount
SUM(Total) AS GrandTotal
...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 15, 2006 at 9:13 am
| Actually, none of them is absolutely right. |
If you have one that is, would you mind sharing it...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 15, 2006 at 9:03 am
Thanks for the feedback, Mark... this one was a lot of fun!
Serqiy... I'd still like to know the "magic" behind your 5 second report, if you get a chance.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 14, 2006 at 4:30 pm
Should the totals be by day for the range or are you just looking for a grand total for the range?
--Jeff Moden
Change is inevitable... Change for the better is not.
October 14, 2006 at 8:31 am
Thanks for the benchmark, Serqiy... the computed columns help a lot especially when you make them both deterministic so they can be indexed... got it down to 7 seconds on 4...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 14, 2006 at 1:34 am
Mark,
I don't know if I can get it to be a fast as Serqiy says he can, but I did get it down to 8 seconds...
First, add this index...
--Jeff Moden
RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.
Change is inevitable... Change for the better is not.
October 14, 2006 at 12:27 am
Serqiy, my old friend... I'm all ears... there's code in the post to gen a million rows... can you show us how to get a similar report as the cross...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 13, 2006 at 10:56 pm
Viewing 15 posts - 57,421 through 57,435 (of 59,101 total)