July 7, 2021 at 7:32 pm
After reading many posts, this is what I learned.
SELECT MIN(StartDate) AS MinDate FROM Schedule WHERE WorkCenterID = 'LAY-W' AND ScheduleID = '5' GROUP BY StartDate
It produces all three values. I just want the Minimum Date Value to be returned.
Thanks!
Steve Anderson
July 7, 2021 at 8:20 pm
If you want a single, minimum value returned, don't group the data.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
July 7, 2021 at 8:56 pm
Exactly. Just this:
SELECT MIN(StartDate) AS MinDate
FROM Schedule
WHERE WorkCenterID = 'LAY-W' AND ScheduleID = '5'
SQL DBA,SQL Server MVP(07, 08, 09) "Money can't buy you happiness." Maybe so, but it can make your unhappiness a LOT more comfortable!
July 16, 2021 at 7:05 am
This was removed by the editor as SPAM
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply