ibm midrange - Create SQL view against AS/400 data -


how create view against table? want select according todays date. field in as400 defined numeric 8 0.

what don't understand is, have recreate table in iseries navigator, order header , detail. exists on as/400 never used in iseries navigator. once view created, should able access via crystal reports.

use create view sql statement create view , convert numeric date sql date.

note if there invalid dates in table cause error when try select data. may have include validation logic in conversion.

for example:

create view myview select      date(substr(digits(yyyymmdd),1,4) ||'-'||     substr(digits(yyyymmdd),4,2) ||'-'||     substr(digits(yyyymmdd),6,2)) mydate mytable 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -