× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




Hi Dina
here is one suggestion
FLD6 is a decimal so you can convert that into character by the use of
DIGITS(FLD6)
This can then be parsed out (love that word) - I am assuming the date in
FLD6 is of the format ddmmyy
SUBSTR(DIGITS(FLD6), 5, 2) || SUBSTR(DIGITS(FLD6), 3, 2) || SUBSTR(DIGITS
(FLD6), 1, 2)
where || is concatenation (I forget the word to use)

This can then be compared to the last six characters of SYSDATE
SELECT FLD1, FLD2, FLD3, FLD4

FROM MYFILE

WHERE
SUBSTR(DIGITS(FLD6), 5, 2) || SUBSTR(DIGITS(FLD6), 3, 2) || SUBSTR(DIGITS
(FLD6), 1, 2) =
SELECT SUBSTR(SYSDATE, 3, 6) FROM SYSPARM WHERE ENV= "PRD")



Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill



dina ramzy
<dina.ramzy@live.
com> To
Sent by: <midrange-l@xxxxxxxxxxxx>
midrange-l-bounce cc
s@xxxxxxxxxxxx
Subject
SQL Question
02/17/2010 09:08
AM


Please respond to
Midrange Systems
Technical
Discussion
<midrange-l@midra
nge.com>








Hi All,



Could you please advise me with this query:



SELECT FLD1, FLD2, FLD3, FLD4

FROM MYFILE

WHERE FLD6 = (SELECT SYSDATE FROM SYSPARM WHERE ENV= "PRD")



The problem is FLD6 is decimal of 6 containing data like 160210

and SYSDTAE is char of 8 containting date like 20100216. and I can not make
the comparison...







Thanks in advance for your help



Dina

_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
https://signup.live.com/signup.aspx?id=60969
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


Hi All,



Could you please advise me with this query:



SELECT FLD1, FLD2, FLD3, FLD4

FROM MYFILE

WHERE FLD6 = (SELECT SYSDATE FROM SYSPARM WHERE ENV= "PRD")



The problem is FLD6 is decimal of 6 containing data like 160210

and SYSDTAE is char of 8 containting date like 20100216. and I can not make
the comparison...







Thanks in advance for your help



Dina

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.