What's the quickest way
*There's an indexed table
1
Sele winhst
seek myclient
if found()
scan while client=myclient
lastinvoicedate=date
endscan
endif
2
select client,date from winhst where client=myclient into cursor temp
if !eof()
go bott
lastinvoicedate=date
endif
--
Regards
Sytze de Boer
Kiss Systems
Hamilton, NZ
Ph: 64-7-8391670, Mob:64 21 937611
URL: www.kiss.co.nz
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/367498c41003181257g2ec08989kf344e9aa9d2ff753@mail.gmail.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.
> -----Original Message-----
> From: profoxtech-bounces@leafe.com
[mailto:profoxtech-bounces@leafe.com]
> On Behalf Of Sytze de Boer
> Sent: Thursday, March 18, 2010 12:58 PM
> To: profoxtech@leafe.com
> Subject: VFP9 - Speed
>
> What's the quickest way
>
> *There's an indexed table
> 1
> Sele winhst
> seek myclient
> if found()
> scan while client=myclient
> lastinvoicedate=date
> endscan
> endif
>
> 2
> select client,date from winhst where client=myclient into cursor temp
> if !eof()
> go bott
> lastinvoicedate=date
> endif
>
The answer is: It Depends...
Can you try them both and see?
Also bear in mind that over time as the data gets bigger, the answer
could change...
Thanks,
Matthew Jarvis || Business Systems Analyst
IT Department
McKenzie-Willamette Medical Center
1460 G Street, Springfield, OR 97477 || Ph: 541-744-6092 || Fax:
541-744-6145
--------------------------------------------------------------------------
Disclaimer: This electronic message may contain information that is
Proprietary, Confidential, or legally privileged or protected. It
is intended only for the use of the individual(s) and entity named
in the message. If you are not an intended recipient of this
message, please notify the sender immediately and delete the
material from your computer. Do not deliver, distribute or copy
this message and do not disclose its contents or take any action in
reliance on the information it contains.
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/69F310C05DD83C48A84BA3769CE1ECF802F6E98E@TNTRIEXEVS02.triadhospitals.net
** 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.
If the values you are seeking are indexed, checkout the indexseek()
function.
Richard E. Quilhot C.N.A.
quilhotr@gmail.com
On Thu, Mar 18, 2010 at 3:57 PM, Sytze de Boer <sytze.kiss@gmail.com> wrote:
> What's the quickest way
>
> *There's an indexed table
> 1
> Sele winhst
> seek myclient
> if found()
> scan while client=myclient
> lastinvoicedate=date
> endscan
> endif
>
> 2
> select client,date from winhst where client=myclient into cursor temp
> if !eof()
> go bott
> lastinvoicedate=date
> endif
>
>
>
>
>
>
> --
> Regards
> Sytze de Boer
> Kiss Systems
> Hamilton, NZ
> Ph: 64-7-8391670, Mob:64 21 937611
> URL: www.kiss.co.nz
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
> text/plain (text body -- kept)
> text/html
> ---
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/bfe30b7d1003181315y2495a5f0t74b44439cca82663@mail.gmail.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.
> -----Original Message-----
> From: profoxtech-bounces@leafe.com
[mailto:profoxtech-bounces@leafe.com]
> On Behalf Of Sytze de Boer
> Sent: Thursday, March 18, 2010 12:58 PM
> To: profoxtech@leafe.com
> Subject: VFP9 - Speed
>
> What's the quickest way
>
> *There's an indexed table
> 1
> Sele winhst
> seek myclient
> if found()
> scan while client=myclient
> lastinvoicedate=date
> endscan
> endif
>
> 2
> select client,date from winhst where client=myclient into cursor temp
> if !eof()
> go bott
> lastinvoicedate=date
> endif
Another way to try this is (winging it):
Select max( date) from winhst where client=myclient
Or something like that...
Thanks,
Matthew Jarvis || Business Systems Analyst
IT Department
McKenzie-Willamette Medical Center
1460 G Street, Springfield, OR 97477 || Ph: 541-744-6092 || Fax:
541-744-6145
--------------------------------------------------------------------------
Disclaimer: This electronic message may contain information that is
Proprietary, Confidential, or legally privileged or protected. It
is intended only for the use of the individual(s) and entity named
in the message. If you are not an intended recipient of this
message, please notify the sender immediately and delete the
material from your computer. Do not deliver, distribute or copy
this message and do not disclose its contents or take any action in
reliance on the information it contains.
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/69F310C05DD83C48A84BA3769CE1ECF802F6E99D@TNTRIEXEVS02.triadhospitals.net
** 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.
On Thu, Mar 18, 2010 at 2:57 PM, Sytze de Boer <sytze.kiss@gmail.com> wrote:
> What's the quickest way
>
> *There's an indexed table
> 1
> Sele winhst
> seek myclient
> if found()
>
3. I'm not sure if this is fastest but this would be my preferred solution
select client, max(date) as lastinvoicedate ;
from winhst ;
where client=myclient ;
group by client ;
order by client ;
into cursor temp
? temp.LastInvoiceDate
Sytze de Boer wrote:
> What's the quickest way
>
> *There's an indexed table
> 1
> Sele winhst
> seek myclient
> if found()
> scan while client=myclient
> lastinvoicedate=date
> endscan
> endif
>
> 2
> select client,date from winhst where client=myclient into cursor temp
> if !eof()
> go bott
> lastinvoicedate=date
> endif
>
>
>
>
>
>
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/4BA28B8A.3060702@cullytechnologies.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.
That needs the Group By 1 (or group by client) on it too.
-----Original Message-----
From: Stephen Russell
Sent: Thursday, March 18, 2010 4:20 PM
On Thu, Mar 18, 2010 at 2:57 PM, Sytze de Boer wrote:
> What's the quickest way
>
> *There's an indexed table
> 1
> Sele winhst
> seek myclient
> if found()
>
Select top 1 lastinvoicedate from winhst order by lastinvoicedate desc
into array laDummy
lastinvoicedate = laDummy[1, 1]
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/1268948279.27952.1365565879@webmail.messagingengine.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.
Sorry you'd need to add a where clause to that SQL statement too:
where client = myclient
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/1268948341.28069.1365566065@webmail.messagingengine.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.
On further reflection:
Select top 1 lastinvoicedate from winhst where client = myclient order
by client, invoicedate desc group by client, invoicedate into array
laResult
lastinvoicdate = laResult[1, 1]
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/1268989773.23870.1365637579@webmail.messagingengine.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.