简体   繁体   中英

SQL on IBM i - Selecting data based on combined fields from DB

We are trying to select records from a file containing sales data where the date in the IBM i file is stored in 3 separate numeric fields (Year, Month, Day). We have a .net application that is using date pickers to select a from and through date range. Is there a way in an SQL statement to combine the 3 fields from the database into a single value so that the database date can be used to make the SQL select easier?

Use the digits command to tie them together. Your parameters will be YYYYMMDD.

Where digits(year) || digits(month) || digits(day)  BETWEEN ? and ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM