Date formats

G

Guest

Hi I am trying to design a query in design view and need to insert the dates
under the criteria. when i give the dates for example as 01/01/2007, it
changes to #01/01/2007# but these dates r not recognised. am i using the
right format? if yes where could i go wrong? cuz when i take the dates off, i
see the data.
 
G

Guest

Nick,

My first guess is that your data actually contains dates and times? This
happens when your program uses the Now() function to store a data/time value
instead of using the Date() function to store only a date value. If that is
the case, change the column to:

FilterDate: DateValue([YourFieldName])
Criteria: #01/01/07#

HTH
Dale
 
G

Guest

Hi Dale,

thank you for the response. I am workin on my query in design mode as i do
not know SQL. i did what u suggested by putting datevalue([begin_date]) in
the field line and under criteria 06/01/2007 but this did not return any
results tho. For ur reference the SQL i see is

WHERE (((datevalue([PAYMENT].[DT_PMNT_BEGIN]))>=#6/1/2007#) AND
((datevalue([PAYMENT].[DT_PMNT_END]))<=#6/30/2007#)



Dale Fye said:
Nick,

My first guess is that your data actually contains dates and times? This
happens when your program uses the Now() function to store a data/time value
instead of using the Date() function to store only a date value. If that is
the case, change the column to:

FilterDate: DateValue([YourFieldName])
Criteria: #01/01/07#

HTH
Dale

--
Email address is not valid.
Please reply to newsgroup only.


nick said:
Hi I am trying to design a query in design view and need to insert the dates
under the criteria. when i give the dates for example as 01/01/2007, it
changes to #01/01/2007# but these dates r not recognised. am i using the
right format? if yes where could i go wrong? cuz when i take the dates off, i
see the data.
 
G

Guest

Nick,

What exactly are you trying to accomplish with this query? The way the
WHERE clause is worded, you want those records where payments began on or
after June 1st, 2007, and the final payment was made (DT_PMNT_END) is on or
before 30 June, 2007. Is that what you want?

Try this:
1.Open your table and click the Filter by Form button
2. In field [DT_PMNT_BEGIN] enter >= #6/1/200#, then click the Apply Filter
button. Sort on the [DT_PMNT_BEGIN] field and look to see if there are any
records where this field is <= #6/30/07#. If not, then the query is working
right.

HTH
Dale
Email address is not valid.
Please reply to newsgroup only.


nick said:
Hi Dale,

thank you for the response. I am workin on my query in design mode as i do
not know SQL. i did what u suggested by putting datevalue([begin_date]) in
the field line and under criteria 06/01/2007 but this did not return any
results tho. For ur reference the SQL i see is

WHERE (((datevalue([PAYMENT].[DT_PMNT_BEGIN]))>=#6/1/2007#) AND
((datevalue([PAYMENT].[DT_PMNT_END]))<=#6/30/2007#)



Dale Fye said:
Nick,

My first guess is that your data actually contains dates and times? This
happens when your program uses the Now() function to store a data/time value
instead of using the Date() function to store only a date value. If that is
the case, change the column to:

FilterDate: DateValue([YourFieldName])
Criteria: #01/01/07#

HTH
Dale

--
Email address is not valid.
Please reply to newsgroup only.


nick said:
Hi I am trying to design a query in design view and need to insert the dates
under the criteria. when i give the dates for example as 01/01/2007, it
changes to #01/01/2007# but these dates r not recognised. am i using the
right format? if yes where could i go wrong? cuz when i take the dates off, i
see the data.
 
G

Guest

Hi Dale, yes whatever u said is what i am trying to acheieve. And there r
records between those dates as well...i checked it in the table.

Dale Fye said:
Nick,

What exactly are you trying to accomplish with this query? The way the
WHERE clause is worded, you want those records where payments began on or
after June 1st, 2007, and the final payment was made (DT_PMNT_END) is on or
before 30 June, 2007. Is that what you want?

Try this:
1.Open your table and click the Filter by Form button
2. In field [DT_PMNT_BEGIN] enter >= #6/1/200#, then click the Apply Filter
button. Sort on the [DT_PMNT_BEGIN] field and look to see if there are any
records where this field is <= #6/30/07#. If not, then the query is working
right.

HTH
Dale
Email address is not valid.
Please reply to newsgroup only.


nick said:
Hi Dale,

thank you for the response. I am workin on my query in design mode as i do
not know SQL. i did what u suggested by putting datevalue([begin_date]) in
the field line and under criteria 06/01/2007 but this did not return any
results tho. For ur reference the SQL i see is

WHERE (((datevalue([PAYMENT].[DT_PMNT_BEGIN]))>=#6/1/2007#) AND
((datevalue([PAYMENT].[DT_PMNT_END]))<=#6/30/2007#)



Dale Fye said:
Nick,

My first guess is that your data actually contains dates and times? This
happens when your program uses the Now() function to store a data/time value
instead of using the Date() function to store only a date value. If that is
the case, change the column to:

FilterDate: DateValue([YourFieldName])
Criteria: #01/01/07#

HTH
Dale

--
Email address is not valid.
Please reply to newsgroup only.


:

Hi I am trying to design a query in design view and need to insert the dates
under the criteria. when i give the dates for example as 01/01/2007, it
changes to #01/01/2007# but these dates r not recognised. am i using the
right format? if yes where could i go wrong? cuz when i take the dates off, i
see the data.
 
D

Dale Fye

Post your entire SQL string and I'll take a look at it to see if there is
anything else that might be causing the problem.

Dale
nick said:
Hi Dale, yes whatever u said is what i am trying to acheieve. And there r
records between those dates as well...i checked it in the table.

Dale Fye said:
Nick,

What exactly are you trying to accomplish with this query? The way the
WHERE clause is worded, you want those records where payments began on or
after June 1st, 2007, and the final payment was made (DT_PMNT_END) is on
or
before 30 June, 2007. Is that what you want?

Try this:
1.Open your table and click the Filter by Form button
2. In field [DT_PMNT_BEGIN] enter >= #6/1/200#, then click the Apply
Filter
button. Sort on the [DT_PMNT_BEGIN] field and look to see if there are
any
records where this field is <= #6/30/07#. If not, then the query is
working
right.

HTH
Dale
Email address is not valid.
Please reply to newsgroup only.


nick said:
Hi Dale,

thank you for the response. I am workin on my query in design mode as i
do
not know SQL. i did what u suggested by putting datevalue([begin_date])
in
the field line and under criteria 06/01/2007 but this did not return
any
results tho. For ur reference the SQL i see is

WHERE (((datevalue([PAYMENT].[DT_PMNT_BEGIN]))>=#6/1/2007#) AND
((datevalue([PAYMENT].[DT_PMNT_END]))<=#6/30/2007#)



:

Nick,

My first guess is that your data actually contains dates and times?
This
happens when your program uses the Now() function to store a
data/time value
instead of using the Date() function to store only a date value. If
that is
the case, change the column to:

FilterDate: DateValue([YourFieldName])
Criteria: #01/01/07#

HTH
Dale

--
Email address is not valid.
Please reply to newsgroup only.


:

Hi I am trying to design a query in design view and need to insert
the dates
under the criteria. when i give the dates for example as
01/01/2007, it
changes to #01/01/2007# but these dates r not recognised. am i
using the
right format? if yes where could i go wrong? cuz when i take the
dates off, i
see the data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top