Just specify a matching format, if the day is missing it will be replaced by the 1st.
where '200605' (date, format 'yyyymm') between date1 and date2
Dieter
I think you are confusing external and internal representation. Is SOURCE_MONTHYEAR actually defined as DATE or is it CHAR that you know is supposed to represent a YYYYMM format date? The FORMAT specification is used for the conversion between external (character string) and internal datatypes (such as DATE). If you aren't doing conversion to/from character, FORMAT isn't relevant.
If SOURCE_MONTHYEAR is a character string, try it the way Dieter suggested.
On the other hand, if VARIABLE1 and VARIABLE2 are actually character strings you'd want to CAST those.
In either case, the FORMAT describes the character string - not the comparison.
I think you are confusing external and internal representation. Is SOURCE_MONTHYEAR actually defined as DATE or is it CHAR that you know is supposed to represent a YYYYMM format date? The FORMAT specification is used for the conversion between external (character string) and internal datatypes (such as DATE). If you aren't doing conversion to/from character, FORMAT isn't relevant.
If SOURCE_MONTHYEAR is a character string, try it the way Dieter suggested.
On the other hand, if VARIABLE1 and VARIABLE2 are actually character strings you'd want to CAST those.
In either case, the FORMAT describes the character string - not the comparison.

My database uses the date format yyyy-mm-dd. I have a new data source that uses yyyymm for a key date. How can I compare the two? I need to essentially do this:
where
yyyymm between yyyy-mm-dd1 and yyyy-mm-dd2