NBS Posted August 29, 2008 Report Share Posted August 29, 2008 (edited) Sveiki, man ir procedūra/operācija "EXEC tabula" Atgriež šādas vērtības: Es vēlos iegūt lielāko datumu, vārdu sakot pēdējo datumu. Piem., man tabula nav sakārtota pēc `uptime` un ir šādas vērtības: Uptime: 2008-07-24 00:00:00 2008-08-07 00:00:00 2008-02-12 00:00:00 ... Vēlētos iegūt vecāko datumu no šiem 3, tas būtu: 2008-08-07 00:00:00 Gribētos zināt, kā to var realizēt iekšs VBScript ? P.S. Paldies, jau iepriekšs. Edited August 29, 2008 by NBS Link to comment Share on other sites More sharing options...
NBS Posted August 29, 2008 Author Report Share Posted August 29, 2008 Vismaz kādas idejas ? Link to comment Share on other sites More sharing options...
bubu Posted August 29, 2008 Report Share Posted August 29, 2008 Visprastākais for cikls. minimālā = vērtības[0] for (i=1; i<count; i++) { if (vērtības[i] < minimālā) { minimālā = vērtības[i]; } } alert(minimālā); Link to comment Share on other sites More sharing options...
NBS Posted August 29, 2008 Author Report Share Posted August 29, 2008 (edited) Testēju kaut ko šādu, neizdodas :( uptime = penalty("uptime") count = penalty.RecordCount minvalue = uptime[0] i = 0 while not penalty.eof for i = 1; i < count; i++) { if (uptime[0] < minvalue) { minvalue = uptime[i] } } Edited August 29, 2008 by NBS Link to comment Share on other sites More sharing options...
Aleksejs Posted August 29, 2008 Report Share Posted August 29, 2008 ... if (uptime[i] < minvalue) { minvalue = uptime[i] } ... Link to comment Share on other sites More sharing options...
NBS Posted August 29, 2008 Author Report Share Posted August 29, 2008 Kļūda: Microsoft VBScript compilation error '800a03f2' Expected identifier /lists/penalty_payments.asp, line 36 for (i = 1; i < count; i++) `It kā jau i ir nodefinēts i = 0` Pilnais kods: http://paste.php.lv/7919?lang=asp Link to comment Share on other sites More sharing options...
bubu Posted August 29, 2008 Report Share Posted August 29, 2008 vbsckriptā vai tad jālieto figūriekavas? Link to comment Share on other sites More sharing options...
NBS Posted August 29, 2008 Author Report Share Posted August 29, 2008 vbsckriptā vai tad jālieto figūriekavas? Nu jā, es izlaboju tāpat neiet :( http://paste.php.lv/7920?lang=asp Link to comment Share on other sites More sharing options...
bubu Posted August 29, 2008 Report Share Posted August 29, 2008 Tad debugo. Link to comment Share on other sites More sharing options...
NBS Posted September 1, 2008 Author Report Share Posted September 1, 2008 Paldies, viss izdevās, izrādās nav tik grūti. Link to comment Share on other sites More sharing options...
Recommended Posts