Convert
Posted in 2001
Topics: Third-Party Tools & Monitoring
How can I convert a Float to and Integer?
The query looks like: SELECT m.match_id, m.home_team as team, count( h.match_id ) as goals FROM match m, OUTER goal h WHERE m.match_type_id = 507 AND m.match_date = TODAY AND m.match_id = h.match_id AND m.home_team = h.team_id GROUP BY m.match_id, m.home_team It's the count() that returns 0.00000E00 when the entry in the goal table in non-existent ( i.e. the team hasn't scored any goals in that match ). I need the count result to be an Integer. "James Smith" <james@sportinglife.com> wrote in message news:m98i6.11$kQ2.150@news.uk.colt.net... > How can I convert a Float to and Integer? > >
In the year of Our Lord Tue, 13 Feb 2001 10:55:00 -0000, "James Smith" <james@sportinglife.com> spake, saying: >The query looks like: > > SELECT > m.match_id, m.home_team as team, > count( h.match_id ) as goals > FROM match m, OUTER goal h > WHERE m.match_type_id = 507 > AND m.match_date = TODAY > AND m.match_id = h.match_id > AND m.home_team = h.team_id > GROUP BY m.match_id, m.home_team > >It's the count() that returns 0.00000E00 when the entry in the goal >table in non-existent ( i.e. the team hasn't scored any goals in that >match ). > >I need the count result to be an Integer. >"James Smith" <james@sportinglife.com> wrote in message >news:m98i6.11$kQ2.150@news.uk.colt.net... >> How can I convert a Float to and Integer? CAST?
Obnoxio The Clown wrote: > > In the year of Our Lord Tue, 13 Feb 2001 10:55:00 -0000, "James Smith" > <james@sportinglife.com> spake, saying: > > >The query looks like: > > > > SELECT > > m.match_id, m.home_team as team, > > count( h.match_id ) as goals > > FROM match m, OUTER goal h > > WHERE m.match_type_id = 507 > > AND m.match_date = TODAY > > AND m.match_id = h.match_id > > AND m.home_team = h.team_id > > GROUP BY m.match_id, m.home_team > > > >It's the count() that returns 0.00000E00 when the entry in the goal > >table in non-existent ( i.e. the team hasn't scored any goals in that > >match ). > > > >I need the count result to be an Integer. > >"James Smith" <james@sportinglife.com> wrote in message > >news:m98i6.11$kQ2.150@news.uk.colt.net... > >> How can I convert a Float to and Integer? > > CAST? HEX? Or TRUNC(COUNT(h.match_id)) AS goals? Don't use DB-Access? Or is it DBD::Informix you're up against, in which case you probably need a patch first posted the better part of a year ago? -- Yours, Jonathan Leffler (Jonathan.Leffler@Informix.com) #include <disclaimer.h> Guardian of DBD::Informix v1.00.PC1 -- http://www.perl.com/CPAN "I don't suffer from insanity; I enjoy every minute of it!"