How to compare a db date field with todays date??

T

Ted Ljong

Hi
FP 2000 Access 2000

In a db query I want to compare todays date with the datein and dateout. The
post should only be listed when todaysdate=datein or todaysdate=dateout or
when todaysdate is between datein and dateout. I have made the query like
this but I don´t know what to wright instead of todaysdate

SELECT * FROM aktuellt WHERE (publ1 = 'j' AND datein <= '::todaysdate::'
AND dateout >= '::todaysdate::')

Is there anyone know what I shall put in the query instead of todaysdate to
get it work.

I appreciate your answer.
Ted
 
T

Thomas A. Rowe

I don't use the FP DRW, but try replacing:

'::todaysdate::'

with

#::todaysdate::#


--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
T

Thomas A. Rowe

See Kathleen reply and disregard my reply because it would require that you
have already define today's date prior to running the query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
T

Ted Ljong

Kathleens reply? where?
Ted
Thomas A. Rowe said:
See Kathleen reply and disregard my reply because it would require that you
have already define today's date prior to running the query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


todaysdate=dateout
 
T

Thomas A. Rowe

Kathleen indicated for you to do:

AND datein <= Date() AND dateout >= Date()


--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
T

Ted Ljong

I have tried this but I only get the messages
One or more form fields were empty. You should provide default values for
all form fields that are used in the query.
/Ted
 
T

Ted Ljong

Kathleen
Just for test I made an easier query,
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein = 'Date()')
I have also tried
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein = '::Date()::')
Same problem.
Ted
 
K

Kathleen Anderson [MVP - FP]

Ted:

If you are using Date() you don't need the ':: ::' around it - those
characters tell the query to pull the date from a search form field on your
page.

The same with the other field - do you have a search form field on your page
named j ?

This KB article may help you understand the differences:
http://support.microsoft.com/default.aspx?scid=kb;[LN];306430

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Ted Ljong said:
Kathleen
Just for test I made an easier query,
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein = 'Date()')
I have also tried
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein =
'::Date()::') Same problem.
Ted

Kathleen Anderson said:
After you make this change, what does your query look like? Can you
post it here?

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Ted Ljong said:
I have tried this but I only get the messages
One or more form fields were empty. You should provide default
values for all form fields that are used in the query.
/Ted

"Kathleen Anderson [MVP - FP]" <[email protected]> skrev i
meddelandet AND datein <= Date() AND dateout >= Date()


--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Kathleens reply? where?
Ted
"Thomas A. Rowe" <[email protected]> skrev i meddelandet
See Kathleen reply and disregard my reply because it would
require that you have already define today's date prior to
running the query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support
see: http://www.net-sites.com/sitebuilder/newsgroups.asp

I don't use the FP DRW, but try replacing:

'::todaysdate::'

with

#::todaysdate::#


--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support
see: http://www.net-sites.com/sitebuilder/newsgroups.asp

Hi
FP 2000 Access 2000

In a db query I want to compare todays date with the datein and
dateout. The post should only be listed when todaysdate=datein
or todaysdate=dateout or when todaysdate is between datein and
dateout. I have made the query like this but I don´t know what
to wright instead of todaysdate

SELECT * FROM aktuellt WHERE (publ1 = 'j' AND datein <=
'::todaysdate::' AND dateout >= '::todaysdate::')

Is there anyone know what I shall put in the query instead of
todaysdate to get it work.

I appreciate your answer.
Ted
 
T

Ted Ljong

Thanks and thanks again Kathleen it works now
I took away the :: round the J (I have no search form) and I took away '::
round the datein
/Ted

Kathleen Anderson said:
Ted:

If you are using Date() you don't need the ':: ::' around it - those
characters tell the query to pull the date from a search form field on your
page.

The same with the other field - do you have a search form field on your page
named j ?

This KB article may help you understand the differences:
http://support.microsoft.com/default.aspx?scid=kb;[LN];306430

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Ted Ljong said:
Kathleen
Just for test I made an easier query,
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein = 'Date()')
I have also tried
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein =
'::Date()::') Same problem.
Ted

Kathleen Anderson said:
After you make this change, what does your query look like? Can you
post it here?

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


I have tried this but I only get the messages
One or more form fields were empty. You should provide default
values for all form fields that are used in the query.
/Ted

"Kathleen Anderson [MVP - FP]" <[email protected]> skrev i
meddelandet AND datein <= Date() AND dateout >= Date()


--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Kathleens reply? where?
Ted
"Thomas A. Rowe" <[email protected]> skrev i meddelandet
See Kathleen reply and disregard my reply because it would
require that you have already define today's date prior to
running the query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support
see: http://www.net-sites.com/sitebuilder/newsgroups.asp

I don't use the FP DRW, but try replacing:

'::todaysdate::'

with

#::todaysdate::#


--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support
see: http://www.net-sites.com/sitebuilder/newsgroups.asp

Hi
FP 2000 Access 2000

In a db query I want to compare todays date with the datein and
dateout. The post should only be listed when todaysdate=datein
or todaysdate=dateout or when todaysdate is between datein and
dateout. I have made the query like this but I don´t know what
to wright instead of todaysdate

SELECT * FROM aktuellt WHERE (publ1 = 'j' AND datein <=
'::todaysdate::' AND dateout >= '::todaysdate::')

Is there anyone know what I shall put in the query instead of
todaysdate to get it work.

I appreciate your answer.
Ted
 
K

Kathleen Anderson [MVP - FP]

That's great!

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Ted Ljong said:
Thanks and thanks again Kathleen it works now
I took away the :: round the J (I have no search form) and I took
away ':: round the datein
/Ted

Kathleen Anderson said:
Ted:

If you are using Date() you don't need the ':: ::' around it - those
characters tell the query to pull the date from a search form field
on your page.

The same with the other field - do you have a search form field on
your page named j ?

This KB article may help you understand the differences:
http://support.microsoft.com/default.aspx?scid=kb;[LN];306430

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Ted Ljong said:
Kathleen
Just for test I made an easier query,
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein =
'Date()') I have also tried
SELECT * FROM aktuellt WHERE (publ2 = '::j::' AND datein =
'::Date()::') Same problem.
Ted

"Kathleen Anderson [MVP - FP]" <[email protected]> skrev i
meddelandet After you make this change, what does your query look like? Can you
post it here?

--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


I have tried this but I only get the messages
One or more form fields were empty. You should provide default
values for all form fields that are used in the query.
/Ted

"Kathleen Anderson [MVP - FP]" <[email protected]> skrev i
meddelandet AND datein <= Date() AND dateout >= Date()


--
~ Kathleen Anderson
Microsoft MVP - FrontPage
Spider Web Woman Designs
http://www.spiderwebwoman.com/resources/


Kathleens reply? where?
Ted
"Thomas A. Rowe" <[email protected]> skrev i meddelandet
See Kathleen reply and disregard my reply because it would
require that you have already define today's date prior to
running the query.

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage support
see: http://www.net-sites.com/sitebuilder/newsgroups.asp

I don't use the FP DRW, but try replacing:

'::todaysdate::'

with

#::todaysdate::#


--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
To assist you in getting the best answers for FrontPage
support see:
http://www.net-sites.com/sitebuilder/newsgroups.asp

Hi
FP 2000 Access 2000

In a db query I want to compare todays date with the datein
and dateout. The post should only be listed when
todaysdate=datein or todaysdate=dateout or when todaysdate
is between datein and dateout. I have made the query like
this but I don´t know what to wright instead of todaysdate

SELECT * FROM aktuellt WHERE (publ1 = 'j' AND datein <=
'::todaysdate::' AND dateout >= '::todaysdate::')

Is there anyone know what I shall put in the query instead of
todaysdate to get it work.

I appreciate your answer.
Ted
 

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