Connecting Tech Pros Worldwide Forums | Help | Site Map

Appointments

Newbie
 
Join Date: Sep 2009
Posts: 2
#1: Sep 4 '09
My Table has the following fields:
ID “Auto number”
firstname “text”
lastname “text”
ptnumber “text” unique number
nextapt “date/time”

Nextapt field contains dates that could be old or new dates for the same person. I want to find a way using DRW, who does not have an appointment! Meaning not today or in the future! Any ideas please?


fp_sQry="SELECT DISTINCT firstname,lastname, ptnumber, enrolled FROM appt WHERE enrolled = 'AC' AND nextapt NOT BETWEEN #::todaydate::# And #::todaydate::#+3650 ORDER BY lastname ASC"

For some reasons it returns people with future appointments as well! New appointments wont go more than max 2 months! Is the syntax correct?

jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#2: Sep 6 '09

re: Appointments


and you don't want to say just "nextapt < getdate()"? (getdate only works in some dbs, and you didn't specify which you are using)

Jared
Newbie
 
Join Date: Sep 2009
Posts: 2
#3: Sep 6 '09

re: Appointments


Thanks 4 reply, I use Access.
jhardman's Avatar
Moderator
 
Join Date: Jan 2007
Location: logan, utah
Posts: 2,690
#4: Sep 8 '09

re: Appointments


okay, try "nextapt < date()"

Jared
Reply