I need some help with the following in sql.
Batches.journal_number to be updated with the journal prefix as per the below table, followed by todays date. I can get the prefix and use getdate() to generate the date but am struggling in converting the format from 11/10/07 to 111007. The end result should be 51111007 for CA batch_type for today.
Example of table:
Batches.batch_type | batch_type_desc | Journal Prefix
CA | Cash | 51
CC | Credit Cards | 52
Please can you help? I need case select (or similar) for each of the batch types, ideally to run as a single script.