OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Old Appointments!

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Old Appointments!
Page: [1]
 
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
Old Appointments! - 6/8/2009 0:16:55   
Hi there,

My table contains the following fields:

Ptnumber
Firstname
Lastname
Nexappt

The past and future appointments are stored in “nextapt” which is a Date/Time field. I want to know who does not have a future appointment so we can follow up later. Here is what I did but is not working.

fp_sQry="SELECT * FROM appt WHERE (nextapt < #::todaydate::#) ORDER BY lastname ASC"

I wanted to sort whoever’s appointment is less than current day “todaydate” also I need to display only one time, name because one person has many old appointments! But again didn’t work! Do you have any idea? Maybe a new approach? thanks


< Message edited by box -- 6/8/2009 10:25:48 >
swoosh

 

Posts: 1535
Joined: 5/18/2002
From: Beaver Falls, PA
Status: offline

 
RE: Old Appointments! - 6/8/2009 9:09:01   
Just to make sure. Do you have a typo just in your post or in your code. You mentioned your field name was "Nexappt" but referenced " nextapt" in your code.

As for displaying non duplicate names you could use the "distinct" keyword:

SELECT DISTINCT "column_name"
FROM "table_name"

_____________________________

Swoooosh
Just Do It!


(in reply to box)
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
RE: Old Appointments! - 6/8/2009 10:27:03   
no is not problem with typo, thanks. any idea please.

(in reply to swoosh)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Old Appointments! - 6/8/2009 12:08:21   
What is the format/definition of nextapt and todaydate?
Is nextapt a timestamp in an Access database?
Is todaydate defined as <%=Now()%> ?
What error are you getting?

_____________________________

:)

Follow us on TWITTER

(in reply to box)
Spooky

 

Posts: 26680
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Old Appointments! - 6/8/2009 16:20:20   
As for displaying non duplicate names you could use the "distinct" keyword: 


I think that was the idea :-)

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to TexasWebDevelopers)
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
RE: Old Appointments! - 6/8/2009 16:20:48   
nextapt and todaydate are Date/Time fields and todaydate is <%response.write(fixTheDate(Date()))%> is the function to send the current date!

(in reply to TexasWebDevelopers)
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
RE: Old Appointments! - 6/9/2009 10:22:55   
I guess there is no solution for my problem!:)

(in reply to box)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Old Appointments! - 6/9/2009 11:34:15   
Still not quite enough information. What error are you getting?
Your function "fixthedate" doesn't tell us anything.
Is the format a short date? long date? general date?
I am just trying to confirm, first, that the formatting for nextapt and todaydate are the same.

_____________________________

:)

Follow us on TWITTER

(in reply to box)
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
RE: Old Appointments! - 6/14/2009 15:16:18   
fp_sQry="SELECT DISTINCT FROM appt1 WHERE (ptnumber = '::ptnumber::' ) "

Database Results Error
Description: The SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.
Number: -2147217900 (0x80040E14)
Source: Microsoft JET Database Engine



what syntax should i use to display the most recent record?

Thanks

< Message edited by box -- 6/14/2009 17:36:36 >

(in reply to TexasWebDevelopers)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Old Appointments! - 6/14/2009 20:45:47   
The format should be sql="SELECT DISTINCT [field] FROM [table] WHERE .....

http://www.texaswebdevelopers.com//examples/sql_intro.asp


_____________________________

:)

Follow us on TWITTER

(in reply to box)
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
RE: Old Appointments! - 6/15/2009 0:44:04   
I dont think this format will work with Database Results Wizard (DRW)!

(in reply to TexasWebDevelopers)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Old Appointments! - 6/15/2009 8:05:03   
sure it will

_____________________________

:)

Follow us on TWITTER

(in reply to box)
box

 

Posts: 167
Joined: 12/10/2002
Status: offline

 
RE: Old Appointments! - 6/15/2009 10:05:48   
if I use this
SELECT DISTINCT * FROM

it displays duplicated records!

but if I use this:

SELECT DISTINCT [field] FROM

I get the following:

Error Type:
ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
/ep/_fpclass/fpdblib.inc, line 48




(in reply to TexasWebDevelopers)
TexasWebDevelopers

 

Posts: 722
Joined: 2/22/2002
From: Dallas, TX
Status: offline

 
RE: Old Appointments! - 6/15/2009 10:56:57   
Box---[field] is just a placeholder for the distinct record you are trying to query---I don't have a clue what that column name is dude!

You are making this too hard on yourself...say the sentence in English and you will get there. "I want to get a distinct record named (your field/column name) from my table named (your table name)...etc."


< Message edited by TexasWebDevelopers -- 6/15/2009 11:02:48 >


_____________________________

:)

Follow us on TWITTER

(in reply to box)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Old Appointments!
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts