As400 SQL: Date to Interger conversion



Date to Int conversion:

 Select 
int(substr(char( year(current date)*10000 + month(current  
date)*100 + day(current date)),3))
from Sysibm/Sysdummy1


2017/05/11 = 170511

To get the integer value of date 8 months from today:

 Select 
int(substr(char( year(current date - 8 Months)*10000 + month(current  date - 8 months)*100 + day(current date - 8 Months)),3))
from Sysibm/Sysdummy1


2016/11/08 = 161,108


Comments

Popular posts from this blog

AS400 : Add a new line in text in email SNDSMTPEMM

AS400 Display: Radio Button (SNGCHCFLD)

AS400 Display File: Check Box (MLTCHCFLD)