Hi Team
I need some help, i have a query and want to write a sql server report that will do a check . If "Stock on Hand = 0" Then it must send a reminder to the recipient mail. That "Critical, Cyclical, Standard and Slow Movement".
SELECT InvWarehouse.StockCode, InvMaster.Description, InvWarehouse.Warehouse, InvWarehouse.QtyOnHand, InvWarehouse.QtyAllocated, InvWarehouse.QtyOnOrder, InvWarehouse.QtyInTransit, InvWarehouse.QtyOnBackOrder
FROM sysproR.dbo.InvMaster InvMaster, sysproR.dbo.InvWarehouse InvWarehouse
WHERE InvMaster.StockCode = InvWarehouse.StockCode
Jithu ThomasPosted Jul 30, 2024, 10:45 AM
Once its work please accept my answer :) happy coding....
Guest UserPosted Jul 30, 2024, 7:43 AM
Hi Jithu
Thanks for your responce, let me work on this will give an update. This should be enough for me to test and write.
Jithu ThomasPosted Jul 30, 2024, 7:30 AM
Configure Database Mail - reference: - https://learn.microsoft.com/en-us/sql/relational-databases/database-mail/configure-database-mail?view=sql-server-ver16
Modify your query to check for
QtyOnHand = 0and format the results for the email.Create a SQL Server Agent Job: