Re: Script

Dale E. Reed Jr. ( (no email) )
Thu, 12 Nov 1998 17:36:49 -0800

Alan D. Criado wrote:
>
> One question. In DELCARE statement below, timeon is being declared twice,
> did you mean to declare timeoff the second time and if so, do you still use
> smalldatetime?

Yes. Just change the second one to timeoff.

> >DECLARE @timeon smalldatetime, @timeon smalldatetime, @userip char(16)
> >
> >Select @timeon = "11/9/96 16:00"
> >Select @timeoff = "11/9/96 22:00"
> >Select @userip = "204.227.164.2"
> >
> >Select UserName, Start=DateAdd(Second,
> >(0-AcctSessionTime-AcctDelayTime), CallDate), Mins=(AcctSessionTime/60),
> > Stop=DateAdd(Second, (0-AcctDelayTime), CallDate),
> >Server=SubString(Server, 1, 15), Port=Str(NASPort,4), IP=FramedAddress
> >
> > from calls, servers
> > where DateAdd(Second, (0-AcctSessionTime-AcctDelayTime), CallDate) >=
> >@timeon
> > and DateAdd(Second, (0-AcctDelayTime), CallDate) <= @timeoff
> > and AcctStatusType = 2
> > and calls.NASIdentifier=servers.ipaddress
> > and FramedAddress = @userip
> > Order By Start
> >
> >GO

-- Dale E. Reed Jr.  (daler@iea-software.com)_________________________________________________________________       IEA Software, Inc.      |  RadiusNT, Emerald, and NT FAQs Internet Solutions for Today  |   http://www.iea-software.com