Hi Foxgang
I am going round the bend with this. Situation. I have a file with dates in
(datetime). The dates are not in order, and have a couple of idiots inputs
including a year 2210 one plus a jan 2013 when it should be jan 2014.
Anyway most are good and in a range.
So what I want to do is set the order to the date (actually a datetime
fields) ok no problem.
Now I want to see what's halfway down. But....
Goto recount()/2 takes me to halfway down the original order which could be
an early date (and is in the file I am trying to sort out). So the question
is how do I find the halfway point in an ordered table. In other words in
this case, halfway down the datetime field. No good looking at min and max
as due to the idiot input of 2210 it turns out to be 2107. I cannot assume
dates as these files are ongoing.
I've got over it with this by select distinct (datetime) order by (datetime)
and going halfway but I am curious how halfway down an ordered table can be
achieved
Al
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/001e01cf5884$030f3790$092da6b0$@com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Go Top
SKIP recount()/2
Paul Newton
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Allen
Sent: 15 April 2014 09:24
To: profoxtech@leafe.com
Subject: halfway down a set order
Hi Foxgang
I am going round the bend with this. Situation. I have a file with dates in (datetime). The dates are not in order, and have a couple of idiots inputs including a year 2210 one plus a jan 2013 when it should be jan 2014.
Anyway most are good and in a range.
So what I want to do is set the order to the date (actually a datetime
fields) ok no problem.
Now I want to see what's halfway down. But....
Goto recount()/2 takes me to halfway down the original order which could be an early date (and is in the file I am trying to sort out). So the question is how do I find the halfway point in an ordered table. In other words in this case, halfway down the datetime field. No good looking at min and max as due to the idiot input of 2210 it turns out to be 2107. I cannot assume dates as these files are ongoing.
I've got over it with this by select distinct (datetime) order by (datetime) and going halfway but I am curious how halfway down an ordered table can be achieved Al
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/9A8106AFB0EF9B44B69045C4448935A2506FAC36@NLBAWEXMBX1.infor.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Thanks Paul. So simple. The answer not you :)
Al
-----Original Message-----
Go Top
SKIP recount()/2
Paul Newton
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/003101cf5890$026a4e90$073eebb0$@com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Hi Allen
For the median do:
select datefield from table into cursor curtemp order by datefield
lnrecord=_tally/2
go lnrecord in curtemp
IF mod(_tally,2)=1
skip in curtemp
retu datefield
else
lndatetime1=datefield
skip in curtemp
return lndatetime1+(datefield-lndatetime1)/2
endif
Dr. Joerg Arand
Consultant Neonatologist
Neonatology
Children's Hospital
University Tuebingen
Calwer Str. 7
D-72076 Tuebingen
Tel.+49-(0)7071-2982211
Tel.+49-(0)7071-2980895 (office)
E-mail:Joerg.Arand(AT)med.uni-tuebingen.de
>>> "Allen" <profox@gatwicksoftware.com> 15.04.2014 10:23 >>>
Hi Foxgang
I am going round the bend with this. Situation. I have a file with
dates in
(datetime). The dates are not in order, and have a couple of idiots
inputs
including a year 2210 one plus a jan 2013 when it should be jan 2014.
Anyway most are good and in a range.
So what I want to do is set the order to the date (actually a datetime
fields) ok no problem.
Now I want to see what's halfway down. But....
Goto recount()/2 takes me to halfway down the original order which
could be
an early date (and is in the file I am trying to sort out). So the
question
is how do I find the halfway point in an ordered table. In other words
in
this case, halfway down the datetime field. No good looking at min and
max
as due to the idiot input of 2210 it turns out to be 2107. I cannot
assume
dates as these files are ongoing.
I've got over it with this by select distinct (datetime) order by
(datetime)
and going halfway but I am curious how halfway down an ordered table
can be
achieved
Al
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance:
http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list:
http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/001e01cf5884$030f3790$092da6b0$@com
** All postings, unless explicitly stated otherwise, are the opinions
of the author, and do not constitute legal or medical advice. This
statement is added to the messages for those lawyers who are too stupid
to see the obvious.
Report [OT] Abuse:
http://leafe.com/reportAbuse/001e01cf5884$030f3790$092da6b0$@com
--- StripMime Report -- processed MIME parts ---
multipart/mixed
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/534D30850200002D0005567D@gwia1.zit.med.uni-tuebingen.de
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Hi Joerg
That is about what I did, but distinct TTOD in the select. I am going to
test speed though it's not a big deal. The skip is simple and I hope faster.
Will play.
Thanks
Al
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Joerg
Arand
Sent: 15 April 2014 13:14
To: profoxtech@leafe.com
Subject: Re: halfway down a set order
Hi Allen
For the median do:
select datefield from table into cursor curtemp order by datefield
lnrecord=_tally/2
go lnrecord in curtemp
IF mod(_tally,2)=1
skip in curtemp
retu datefield
else
lndatetime1=datefield
skip in curtemp
return lndatetime1+(datefield-lndatetime1)/2
endif
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/008501cf589d$5d2d18a0$178749e0$@com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Hi Allen,
first thank you for the explanation off the gomonth()-problem, but we
are in old Europe ;-)
For the median a SELECT DISTINCT don't gives the right value!
The Skip is much more easy but returns only the median in uneven counts
of records.
Dr. Joerg Arand
Consultant Neonatologist
Neonatology
Children's Hospital
University Tuebingen
Calwer Str. 7
D-72076 Tuebingen
Tel.+49-(0)7071-2982211
Tel.+49-(0)7071-2980895 (office)
E-mail:Joerg.Arand(AT)med.uni-tuebingen.de
>>> "Allen" <profox@gatwicksoftware.com> 15.04.2014 13:25 >>>
Hi Joerg
That is about what I did, but distinct TTOD in the select. I am going
to
test speed though it's not a big deal. The skip is simple and I hope
faster.
Will play.
Thanks
Al
-----Original Message-----
From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of
Joerg
Arand
Sent: 15 April 2014 13:14
To: profoxtech@leafe.com
Subject: Re: halfway down a set order
Hi Allen
For the median do:
select datefield from table into cursor curtemp order by datefield
lnrecord=_tally/2
go lnrecord in curtemp
IF mod(_tally,2)=1
skip in curtemp
retu datefield
else
lndatetime1=datefield
skip in curtemp
return lndatetime1+(datefield-lndatetime1)/2
endif
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance:
http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list:
http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/008501cf589d$5d2d18a0$178749e0$@com
** All postings, unless explicitly stated otherwise, are the opinions
of the author, and do not constitute legal or medical advice. This
statement is added to the messages for those lawyers who are too stupid
to see the obvious.
Report [OT] Abuse:
http://leafe.com/reportAbuse/008501cf589d$5d2d18a0$178749e0$@com
--- StripMime Report -- processed MIME parts ---
multipart/mixed
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/534D370F0200002D00055682@gwia1.zit.med.uni-tuebingen.de
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Don't think old Europe has much sway on Microsoft. Sorry about that. And
Skip didn't work either. Don't know why but I am a bit fed up with it so
just used what I was doing. I'm not looking for a Median as such because of
the rubbish dates. What I am looking for is to see if the file is for a
particular airline season. So near enough will do it.
Al
-----Original Message-----
Hi Allen,
first thank you for the explanation off the gomonth()-problem, but we are in
old Europe ;-)
For the median a SELECT DISTINCT don't gives the right value!
The Skip is much more easy but returns only the median in uneven counts of
records.
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/008f01cf58a3$aa2f3dd0$fe8db970$@com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.