× 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.



To convert a date into a numeric representation in the format YYYYMMDD, try
the following:

Dec(Replace(Char(MyDate, ISO), '-', ''), 8, 0)


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"


-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Alan Shore
Gesendet: Monday, 12. July 2010 18:04
An: Midrange Systems Technical Discussion
Cc: midrange-l@xxxxxxxxxxxx; midrange-l-bounces@xxxxxxxxxxxx
Betreff: Re: I am converting a date to a floating/double field in SQL. Using
day(date_field) returns 1 and not 01.


Hi Darryl
I'm wondering if day is defined as numeric and being zero suppressed I'm
guessing but try the following FLOAT(CHAR( (YEAR(DATE_FIELD) ||
MONTH(DATE_FIELD) || digit(DAY
(DATE_FIELD)) ))



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



"Darryl Freinkel"
<dfreinkel@assign
ment400.com> To
Sent by: <midrange-l@xxxxxxxxxxxx>
midrange-l-bounce cc
s@xxxxxxxxxxxx
Subject
I am converting a date to a
07/12/2010 12:00 floating/double field in SQL. Using
PM day(date_field) returns 1 and not
01.

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






I am converting a date field to a floating field - YYYY-MM-DD to a floating
field.



The SQL command I am using is FLOAT or DOUBLE and I convert the date field
as follows:

FLOAT(CHAR( (YEAR(DATE_FIELD) || MONTH(DATE_FIELD) || DAY(DATE_FIELD) ))



The system (V5R3) returns the day portion with the leading zero suppressed
that is 2001-05-09 is returned as 2001059.00000000. It should return
20010509.00000000.



Can anyone help with this problem?



The problem I have is that I cannot convert it back to a date field in a
later process.



Does anyone have a solution.



TIA



Darryl Freinkel

Assignment 400 Group, Inc.

Tel: 770.321.8562 ext 111 | Fax 770.321.8562 | 2247 La Salle Dr, Marietta
GA, 30062, USA | PO Box 72556, Marietta, GA 30007-2556



--
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-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.