erikson Posted March 27, 2007 Share Posted March 27, 2007 Hi how i cand get the biggest value ( is a decimal field) from a database? i use mysql.au3 i try something like this $ord = _Query($sql,"SELECT crt, MAX(my_field) FROM table GROUP BY obs") With $ord $test = .Fields("my_field").value filewrite ("c:\order.txt", $test) While NOT .EOF .MoveNext WEnd EndWith but don`t work Link to comment Share on other sites More sharing options...
Zedna Posted April 7, 2007 Share Posted April 7, 2007 Hi how i cand get the biggest value ( is a decimal field) from a database? i use mysql.au3 i try something like this $ord = _Query($sql,"SELECT crt, MAX(my_field) FROM table GROUP BY obs") With $ord $test = .Fields("my_field").value filewrite ("c:\order.txt", $test) While NOT .EOF .MoveNext WEnd EndWith but don`t work 1) use crt in GROUP BY 2) read value inside While loop (and not outside) 3) I'm not sure if .Fields ("my_field") is corrects, test real names of columns Something like this (not tested): $ord = _Query ($sql, "SELECT crt, MAX(my_field) FROM table GROUP BY crt") $test = '' With $ord While Not .EOF $test &= .Fields ("my_field").value .MoveNext WEnd EndWith FileWrite("c:\order.txt", $test) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now