Hi there,
I need to create a stored procedure that inserts into a table with only about 5 different fields.
2 Fields I can hardcode, as these will not change, but the other three will change each time the SP is run, they are Value, Date, and Time.
Value can be determined from a select statement...
SELECT (SUM(Price)/17)*1.886 AS Value
FROM v_Search
Date and Time however will be a bit more tricky I feel, because these two values aren't stored as Datetime datatypes, but instead as Char.
Date is a Char of 8 characters, and Time is 6
typical values for these two fields are 20010520 for date, and 191510 for time, I'm sure you can see how these may have been derived. YYYYMMDD and HHMMSS
Anyway back to my problem. I need a stored procedure that doesn't take any input except from other tables, and that can dynamically generate the date and time in the above format to insert into the target table
Any clues will be much appreciated
Cheers,
Alex.
I need to create a stored procedure that inserts into a table with only about 5 different fields.
2 Fields I can hardcode, as these will not change, but the other three will change each time the SP is run, they are Value, Date, and Time.
Value can be determined from a select statement...
SELECT (SUM(Price)/17)*1.886 AS Value
FROM v_Search
Date and Time however will be a bit more tricky I feel, because these two values aren't stored as Datetime datatypes, but instead as Char.
Date is a Char of 8 characters, and Time is 6
typical values for these two fields are 20010520 for date, and 191510 for time, I'm sure you can see how these may have been derived. YYYYMMDD and HHMMSS
Anyway back to my problem. I need a stored procedure that doesn't take any input except from other tables, and that can dynamically generate the date and time in the above format to insert into the target table
Any clues will be much appreciated
Cheers,
Alex.