Thursday, November 18, 2004

This is my first blog

This is my first blog

the day is fine.

got some tweaking in one stored proc, where i just put some ordering in the motor's accessories and spare parts report.

program's user feedback:

nice feature! :P




And fixed the floating branch transfer:


CREATE PROCEDURE GetFloatingMbNo @ReceivingBranchCode as varchar(2)

AS

SELECT MbNo=substring(MbNo,4,11),MbDate
FROM MotorMovedToBranchHeader AS MNB
WHERE MNB.ToBranchCode=@ReceivingBranchCode

/* this condition will make motor that will be moved to other branch before its installation date not to appear floating transfer */
AND MNB.MbDate >
(SELECT InstallDate FROM MotorInstallationHeader WHERE BranchCode = @ReceivingBranchCode)

AND NOT EXISTS
(SELECT * FROM MotorReceivedFromBranchHeader AS MRB
WHERE MRB.FromBranchMbNo=MNB.MbNo )
GO




0 Comments:

Post a Comment

<< Home