|
| |
|
|
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: 1574 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!
|
|
|
|
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.
|
|
|
|
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!
|
|
|
|
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 >
|
|
|
|
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)!
|
|
|
|
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
|
|
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
|
|
|