Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Data with Minimum Date
Message
 
 
To
26/08/2008 13:57:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01341907
Message ID:
01341912
Views:
8
>I know I have asked this before but the SPT statement was not as complicated. I need the gentime to be the minimum when two or more records are on the same date.
>
>String sql = "SELECT min(gentime) as GenTime, link1, gatetype FROM history" +;
>" Join cardholder On history.link3 = cardholder.recordid" +;
>" Join gatenames On history.link1 = gatenames.gatenumb" +;
>" WHERE cardholder.note1 = '56230'" +;
>" And gentime >= '" + gateactivityarray[i][0] +;
>"' And gentime < '" + tempDate + "' group by link1, gatetype, DateField Order By gentime"

Steven,

See changes inline.

If this is not what you want, please give more info about tables structures and may be some sample data. I'm suspecting you may need derived tables with inner join but this would not work with SPT.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform