×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Try using digits(spcrdt) instead of char(spcrdt). Digits doesn't remove the
leading zeroes.

Thanx, PLA

On 11/10/05, Brian Piotrowski <bpiotrowski@xxxxxxxxxxxxxxx> wrote:
>
> Thanks Richard.
>
> The only problem is that the field is a 4S 0, so when the time less than
> 10:00am, it will only display those characters not equal to 0. So when
> I look at the table, 12:03am is really 3, 2:55am is really 255, etc.
>
> Brian.
>
> -----Original Message-----
> From: Richard ECUYER [mailto:recuyer@xxxxxxx]
> Sent: Thursday, November 10, 2005 10:04 AM
> To: Midrange Systems Technical Discussion
> Subject: Re: Select Results in a DB2 statement
>
> perhaps :
>
> select * from SST30 where spplcd ='2' and
>
> concat(char(spcrdt),char(spcrtm)) >='200511030600' and
>
> concat(char(spcrdt),char(spcrtm)) <='200511040200'
>
> order by spcrdt, spcrtm
>
>
> ----- Original Message -----
> From: "Brian Piotrowski" <bpiotrowski@xxxxxxxxxxxxxxx>
> To: "Midrange Systems Technical Discussion" <midrange-l@xxxxxxxxxxxx>
> Sent: Thursday, November 10, 2005 3:53 PM
> Subject: Select Results in a DB2 statement
>
>
> Hi All,
>
>
>
> I have an SQL statement that has this:
>
>
>
> select * from SST30 where spplcd ='2' and
>
> concat(char(spcrdt),char(spcrtm)) >='20051103600' and
>
> concat(char(spcrdt),char(spcrtm)) <='20051104200'
>
> order by spcrdt, spcrtm
>
>
>
> When I run the statement, I get a list of records between 2005/11/04
> 7:43 am and 2005/11/05 19:04pm. However, the records I am expecting it
> to return should be between 2005/11/03 6:00am and 2005/11/04 2:00am.
>
>
>
> I did check our DB2 table, and there indeed records in there from
> 2005/11/03 6:56am and 2005/11/03 22:23pm. Why doesn't this statement
> pick up these records? Does it have something to do with using the
> concat command and converting the values to characters? If so, is there
> a better way to handle this conversion?
>
>
>
> Thanks!
>
>
> Brian.
>
>
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
>
> Brian Piotrowski
>
> Specialist - I.T.
>
> Simcoe Parts Service, Inc.
>
> PH: 705-435-7814
>
> FX: 705-435-6746
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-
>
>
>
> --
> 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.
>
>
> --
> 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.
>
>
>
> --
> 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.
>
>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2026 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.