** This thread discusses the article: TechTip: Exploit DB2 Web Query's Defined and Computed Fields **
I need to develop a couple defined fields to mimic the following SQL; Vaeddt Between Current_date -14 Days And Current_date +14 Days Vaeedt is a date in *ISO format. I have attempted to create a couple defined fields using the following code; -* DEFINE BEGIN PastBBKS PastBBKS/MDYY = DATEADD (&DATE, 'D', -14); -* DEFINE END PastBBKS -* DEFINE BEGIN FutureBBKS FutureBBKS/MDYY = DATEADD (&DATE, 'D', 14); -* DEFINE END FutureBBKS However, when I include those two fields in the results they show up as; PastBBKS FutureBBKS 12/18/1900 01/14/1901 My selection criteria I created; WHERE [...] AND (MT_RIMVIAPF.MT_RIMVIAPF.VAEDDT GE PastBBKs) AND (MT_RIMVIAPF.MT_RIMVIAPF.VAEDDT LE FutureBBKS); How do I accomplish what I need? I attempted to use the SQL register value of CURRENT_DATE but that did not work either. Thanks, Matt
I need to develop a couple defined fields to mimic the following SQL; Vaeddt Between Current_date -14 Days And Current_date +14 Days Vaeedt is a date in *ISO format. I have attempted to create a couple defined fields using the following code; -* DEFINE BEGIN PastBBKS PastBBKS/MDYY = DATEADD (&DATE, 'D', -14); -* DEFINE END PastBBKS -* DEFINE BEGIN FutureBBKS FutureBBKS/MDYY = DATEADD (&DATE, 'D', 14); -* DEFINE END FutureBBKS However, when I include those two fields in the results they show up as; PastBBKS FutureBBKS 12/18/1900 01/14/1901 My selection criteria I created; WHERE [...] AND (MT_RIMVIAPF.MT_RIMVIAPF.VAEDDT GE PastBBKs) AND (MT_RIMVIAPF.MT_RIMVIAPF.VAEDDT LE FutureBBKS); How do I accomplish what I need? I attempted to use the SQL register value of CURRENT_DATE but that did not work either. Thanks, Matt
Comment