Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
184 views
in Technique[技术] by (71.8m points)

conditions in input prompt for SQL statement

I want extract data from Table.

I need put filter user's input from prompt to continue the extraction of data.

I want the user to enter the first three specific numbers of a general ledger in the prompt so it will start extract otherwise it ask again to enter the correct first three codes/number.

Here is what I have come up with already..

// gl Trans Extract
select
    gl-accountcode
    gl-subledger-code
    gl-other-side
    gl-trans-type
    gl-trans-date
    gl-reference
    gl-details
    gl-batch-ref
    gl-amount
    gl-tr-date-stamp
    gl-tr-time-stamp
    gl-tr-uid
    gl-tr-job-code
    gltr-special-account-name
    gl-trans-no
    gl-master-updated-flag
    gl-tr-user-only-date1
    gl-tr-user-only-alpha4-1
    gl-tr-user-only-alpha4-2
    gl-tr-user-only-num1
    gl-tr-user-only-num2
    gl-tr-analysis-code1
    gl-tr-asset-no
    gl-tr-document-type
    gl-tr-document-no
    gl-tr-document-suffix
    gl-tr-document-seq
    gl-tr-entity-code
    gl-tr-transacted-currency-code
    gl-tr-transacted-currency-amt
    gl-tr-analysis-code2
    gl-tr-financial-year
    gl-tr-financial-period
    gl-tr-record-status
    gl-tr-transacted-currency-rate
    gl-tr-pa-posting-date
    

    ws-input-company-code = input
        alpha
        prompt is "Enter Company Code: "


    ws-input-fin-year = input
        numeric
        prompt is "Enter Financial Year: "
    ws-input-period = input
        numeric
        prompt is "Enter Financial Period: "

from
    gl-trans
where
    gl-accountcode NOT LIKE "______9%"
    AND
    gl-accountcode NOT LIKE "130%"
    AND
    gl-accountcode NOT LIKE "Z"
    AND
    gl-tr-financial-year = ws-input-fin-year
    AND
    gl-tr-financial-period = ws-input-period
    AND
    gl-tr-entity-code =  ws-input-company-code

format is excel

question from:https://stackoverflow.com/questions/66056007/conditions-in-input-prompt-for-sql-statement

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...