Skip to main content

All Questions

Tagged with
13 votes
2 answers
6k views

Sales, Taxes and Totals

I'm working to get some practice with SQL functions which are often used in a financial setting, and I created this simple table with products, prices and tax rates basically. I then wrote a query to ...
Phrancis's user avatar
  • 20.4k
4 votes
1 answer
2k views

Luhn algorithm MS-SQL

This a solution Luhn algorithm for credit validation. This algorithm is a basic one inspired by wikipedia. I mean no check for length, type, and so on. You can enhance the base code as you want it to ...
Modhaffer's user avatar
2 votes
2 answers
1k views

Timeouts when calculating stock ratings using LINQ

I'm getting a lot of timeouts with the following code and I'm running this method around 10,000 times so I need to figure out how I can optimize this so the timeouts will stop. I am getting timeout ...
DarthVegan's user avatar
12 votes
4 answers
15k views

LW, MTD, STD, YTD Sales... all in line and looking pretty

That's Last Week, Month-to-Date, Season-to-Date, and Year-to-Date sales. I have a table-valued function for each one, that takes a date and returns all CalendarDate...
Mathieu Guindon's user avatar
1 vote
2 answers
2k views

Maintaining a total balance of debit/credit sales transactions

The overall intent is to consolidate individual sales transactions to total debits/credits summing up the totals by year and month--retaining a running balance from start to end. This code uses ...
plditallo's user avatar
  • 251