Forums
This topic is locked
Data Type Mismatch in Criteria Expression
17 Jun 2004 00:04:03 g m posted:
I have what I hope is a simple question.I am using ASP/VBscript and an Access DB.
I have a recordset rsGallery that contains a number of fields..... id, galCat, galShowDate, etc. For some reason, I am having a problem sending to a detail page by passing the URL Parameter galShowDate which is a short date formatted field in the DB. On the detail
page, when I put in a
simple filter........
galShowDate = URL Parameter galShowDate
I hit test and put in a sample parameter 07/15/1999 and I get this error....
Data Type Mismatch in Criteria Expression
Am I doing something wrong? I used to have the date field formatted in a basic text format, but it wasn't sorting by year for me that way. I want it to really sort by date, so I figured making the field in the DB into short date format. It now sorts the galleries on the gallery page correctly, but when I try to pass the variable galShowDate to the detail page, it gives me the error I referred to earlier.
Thanks in advance for your direction,
Gil
Edited by - huligan1 on 17 Jun 2004 00:06:36
Replies
Replied 17 Jun 2004 02:33:26
17 Jun 2004 02:33:26 Kent Steelman replied:
try this use xx/xx/xx format for your filter.. Also is your filter field formated for date... if so is it formated for short date?
Wm. Kent Steelman
Wm. Kent Steelman
Replied 17 Jun 2004 10:37:22
17 Jun 2004 10:37:22 g m replied:
Thanks for the reply Kent,
I am not exactly sure how to create a filter that is formatted for date or that is formatted for short dates. The field in the database is definitely set up as a date field and short date format.
Any direction would be awesome. I have gone back to sorting by the name, but I would much rather sort by date since sometimes the name could be the same. If forced I will make it so each name will be unique.
Thanks again,
Gil
I am not exactly sure how to create a filter that is formatted for date or that is formatted for short dates. The field in the database is definitely set up as a date field and short date format.
Any direction would be awesome. I have gone back to sorting by the name, but I would much rather sort by date since sometimes the name could be the same. If forced I will make it so each name will be unique.
Thanks again,
Gil
Replied 17 Jun 2004 14:21:57
17 Jun 2004 14:21:57 Dave Thomas replied:
easier to sort by your ID desc,
then the latest record is always shown and no confusing the script by having to work out dates and times.
my 2cents
Regards,
Dave
[img]www.nova-cs.co.uk/DmxAvatar.jpg" border="0">
[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
then the latest record is always shown and no confusing the script by having to work out dates and times.
my 2cents
Regards,
Dave
[img]www.nova-cs.co.uk/DmxAvatar.jpg" border="0">
[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
Replied 18 Jun 2004 01:48:05
18 Jun 2004 01:48:05 g m replied:
Unfortunately, I cannot sort by ID since the page I am sending to is displaying more than one record. It is displaying all records that are the same date (or now same unique name).
Not a huge deal to sort by name for now, so I will just deal with it unless I can figure out how to send the date as a URL parameter without the error....
Thanks for your input!
Gil
Not a huge deal to sort by name for now, so I will just deal with it unless I can figure out how to send the date as a URL parameter without the error....
Thanks for your input!
Gil
Replied 18 Jun 2004 02:57:07
18 Jun 2004 02:57:07 Dave Thomas replied:
you may need to use #date# as access is funny about using wrapping the dates with the has sign '#'
Regards,
Dave
[img]www.nova-cs.co.uk/DmxAvatar.jpg" border="0">
[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]
Regards,
Dave
[img]www.nova-cs.co.uk/DmxAvatar.jpg" border="0">
[DWMX 2004]|[FlashMX 2004 Pro]|[Studio MX 2004]|[SQL]|[Access2000/2002]|[ASP/VBScript]|[XP-Pro]