G
Guest
Hey,
I have db update process all in queries, but I need to have it as a code
procedures.
Have little knowledge in code writing. I don't know if it's possible and I
would appreciate any help with it.
Here is SQL of the queries that i need to have as codes:
1. UPDATE Cyc17 SET Cyc17.[Date] = LastWorkDay(DateSerial(Year([Enter any
date in the month being updated in format: mm/dd/yyyy]),Month([Enter any date
in the month being updated in format: mm/dd/yyyy])+1,0));
2. INSERT INTO Cyc17_agr ( [Date], Del, units, amounts )
SELECT Cyc17.Date, Cyc17.del, Cyc17.units, Cyc17.amounts
FROM Cyc17;
3. DELETE Cyc17_agr.Del
FROM Cyc17_agr
WHERE (((Cyc17_agr.Del) Is Null));
4. UPDATE Cyc17_agr SET Cyc17_agr.amounts = 0
WHERE (((Cyc17_agr.amounts) Is Null));
LastWorkDay is the function that returns the last working day of the month.
I thought may be I should try to create 4 different procedures and then call
them from the main procedure. Or maybe it's possible to have all of it in the
one function. I don't know. Waiting for someone's help. Thank you. Juli.
I have db update process all in queries, but I need to have it as a code
procedures.
Have little knowledge in code writing. I don't know if it's possible and I
would appreciate any help with it.
Here is SQL of the queries that i need to have as codes:
1. UPDATE Cyc17 SET Cyc17.[Date] = LastWorkDay(DateSerial(Year([Enter any
date in the month being updated in format: mm/dd/yyyy]),Month([Enter any date
in the month being updated in format: mm/dd/yyyy])+1,0));
2. INSERT INTO Cyc17_agr ( [Date], Del, units, amounts )
SELECT Cyc17.Date, Cyc17.del, Cyc17.units, Cyc17.amounts
FROM Cyc17;
3. DELETE Cyc17_agr.Del
FROM Cyc17_agr
WHERE (((Cyc17_agr.Del) Is Null));
4. UPDATE Cyc17_agr SET Cyc17_agr.amounts = 0
WHERE (((Cyc17_agr.amounts) Is Null));
LastWorkDay is the function that returns the last working day of the month.
I thought may be I should try to create 4 different procedures and then call
them from the main procedure. Or maybe it's possible to have all of it in the
one function. I don't know. Waiting for someone's help. Thank you. Juli.