Forums

This topic is locked

Short Date Format in Access/ASP not working

Posted 25 Jul 2002 20:44:49
1
has voted
25 Jul 2002 20:44:49 Mitchel Tendler posted:
I have a date field in an Access table set to short format and the default value set to NOW()

If I create a recordset and drag the date field to the ASP page, and set the format to short date via the Data Bindings/Format tab and display it, the results are OK, I get:

7/25/2002


The problem is that I am now trying to create a Date Range query using this simple code:

SELECT *
FROM main_ca
WHERE date_submit BETWEEN MMdatefrom AND MMdateto
ORDER BY id_stamp DESC

If MMdatefrom = 7/22/2002
and
If MMdateto = 7/25/2002

I get no results, but if enter

MMdatefrom = 0
MMdateto = 99999

It works??

I then went into access to look at the records and they read in this format 7/22/02 UNTIL I click in the cell and then it reads: 7/22/02 12:27:34 PM , I think that is the problem.

Any ideas how I can fix that?

Thanks!

Mitch

Replies

Replied 25 Jul 2002 20:57:46
25 Jul 2002 20:57:46 Mitchel Tendler replied:
<font color=red>FIGURED IT OUT...thought I would share. <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle></font id=red>

Changed the RS to:

SELECT *
FROM main_ca
WHERE date_submit BETWEEN #MMdatefrom# AND #MMdateto#
ORDER BY id_stamp DESC


instead of:


SELECT *
FROM main_ca
WHERE date_submit BETWEEN MMdatefrom AND MMdateto
ORDER BY id_stamp DESC

Reply to this topic