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]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- OT: SQL Question Tony Carcieri
- RE: SQL Question Rob Rohan
- Re: OT: SQL Question Jochem van Dieten
- RE: OT: SQL Question Tony Carcieri
- CF & Currency Conversion Srimanta
- OT: SQL Question Jeff Chastain
- Re: OT: SQL Question Stephen Hait
- OT: SQL Question Cutter (CF-Talk)
- RE: SQL Question Mosh Teitelbaum
- ot: sql question Tony Weeg
- Re: ot: sql question Tony Weeg
- Re: ot: sql question Jochem van Dieten
- RE: ot: sql question Tony Weeg
- ot: sql question Tony Weeg
- RE: sql question Paul Vernon
- RE: sql question Tony Weeg
- RE: sql question Andy Ousterhout
- ot: sql question Tony Weeg
- Re: sql question Paul Hastings
- Re: ot: sql question Qasim Rasheed
- Re: ot: sql question Tony Weeg