troubleshooting Question

SQL 2008 Dates

Avatar of W.E.B
W.E.B asked on
Microsoft SQL Server 2008
22 Comments1 Solution295 ViewsLast Modified:
Can you please help,

I use below code
SELECT WaybillNumber, ShipmentDate,Scanin,ScantoTtruck FROM ScanItem WHERE shipmentdate > = (Select datediff(d, 0, getdate())-7) AND ScanIn IS NOT NULL and Scanin = (SELECT MAX(Scanin) FROM ScanItem);

This will give me the max scanin for all 7 days,

I need to have the max scanin per day.

how do I update
Update scanitme set scanin =  dateadd(second,5, MAX SCANIN)  FROM ScanItem);--- for that specific shipmentdate

Any help is appreciated,

Join our community to see this answer!
Unlock 1 Answer and 22 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 22 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros