I have a SQL query that I wish to select a specific field entry based on the previous month.
The purpouse of which is to run the table on a schedule without re-creating it each month.
The field I wish to interrogate contains a text string made up as follows:-
“yymm” = for example “0712” for the month of December 2007.
I can see that using a select statement of the kind … DatePart(“m”,
…Would achieve a prior month result if the Invoicedate field is actually a date formatted field.
How would I achieve the equivalent on my table field (using string conversion)to obtain the same result.
Alas there is no actual date field in the table I am querying.
Any assistance would be much appreciated.
Many thanks,
Rob.