Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
enniwesw
Starting Member
8 Posts |
Posted - 2009-07-09 : 08:55:51
|
| failing to build a query to view date an item was last sold tried but it ain't workingSELECT warehouse,product, MAX(movement_date) AS last_date_sold, MIN(movement_date) AS first_date_soldFROM scheme.stkhstmGROUP BY (product, warehouse) |
|
|
rohitkumar
Constraint Violating Yak Guru
472 Posts |
Posted - 2009-07-09 : 08:57:46
|
| query looks correct, can you post some sample data and table structure? |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-07-09 : 09:20:39
|
ain't workingThat is no information to force help. No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
karthik_padbanaban
Constraint Violating Yak Guru
263 Posts |
Posted - 2009-07-09 : 09:39:26
|
quote: Originally posted by enniwesw failing to build a query to view date an item was last sold tried but it ain't workingSELECT warehouse,product, MAX(movement_date) AS last_date_sold, MIN(movement_date) AS first_date_soldFROM scheme.stkhstmGROUP BY (product, warehouse)
SELECT warehouse,product, MAX(movement_date) AS last_date_sold, MIN(movement_date) AS first_date_soldFROM scheme.stkhstmGROUP BY product, warehouseKarthik |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2009-07-09 : 13:53:15
|
quote: Originally posted by webfred ain't workingThat is no information to force help. No, you're never too old to Yak'n'Roll if you're too young to die.
How about "I will buy you a MAISEL'S WEIZEN KRISTALL-KLAR"Will that force you to help? http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-07-10 : 02:59:40
|
quote: Originally posted by DonAtWork
quote: Originally posted by webfred ain't workingThat is no information to force help. No, you're never too old to Yak'n'Roll if you're too young to die.
How about "I will buy you a MAISEL'S WEIZEN KRISTALL-KLAR"Will that force you to help? http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspxHow to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxFor ultra basic questions, follow these links.http://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp
Not a bad idea but i prefer this   No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|
|
|