----- Original Message -----
From: Eric Creese
To: CF-Talk
Sent: Wednesday, October 01, 2003 4:59 PM
Subject: RE: sql question
I do not think you need the SELECT
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 9:56 AM
To: CF-Talk
Subject: RE: sql question
something like this?
but im getting this error...
===============error text======================
Server: Msg 156, Level 15, State 1, Line 13
Incorrect syntax near the keyword 'select'.
Server: Msg 170, Level 15, State 1, Line 13
Line 13: Incorrect syntax near '>'.
===============error text======================
select r.IpAddressNumber, v.VehicleIp,
Count(r.ReportId) as ReportsInDatabase,
Count(DISTINCT Time) as DistinctTimes, v.VehicleName, c.companyName
from reportsView r
INNER JOIN
vehicletable v
on v.IpAddressNumber = r.IpAddressNum
INNER JOIN
companyTable c
on v.companyIdNumber = c.companyIdNumber
where r.currentDate between '09-29-2003 00:00:00.000' and '09-29-2003
23:59:59.999'
Group By v.IpAddressNumber, r.IpAddressNum, v.VehicleName, v.VehicleIp,
c.companyName
HAVING select (((reportsInDatabase - distinctTimes) / reportsInDatabase) *
100) > 15
Order by ReportsInDatabase DESC
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-----Original Message-----
From: Tony Weeg [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 01, 2003 10:51 AM
To: CF-Talk
Subject: ot: sql question
how would I use HAVING to select out where the difference between
reportsInDatabase and DistinctTimes is above 15% im stuck and its just not
clicking this morning....thanks if you can figure this out....
select r.IpAddressNumber, v.VehicleIp,
Count(r.ReportId) as ReportsInDatabase, Count(DISTINCT Time) as
DistinctTimes, v.VehicleName, c.companyName from reportsView r INNER JOIN
vehicletable v on v.IpAddressNumber = r.IpAddressNum INNER JOIN companyTable
c on v.companyIdNumber = c.companyIdNumber where r.currentDate between
'09-29-2003 00:00:00.000' and '09-29-2003 23:59:59.999'
Group By v.IpAddressNumber, r.IpAddressNum, v.VehicleName, v.VehicleIp,
c.companyName Order by ReportsInDatabase DESC
im stuck
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
________________________________
_____
[ Todays Threads
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

