A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

where clause



 
 
Thread Tools Display Modes
  #1  
Old November 7th, 2009, 08:46 PM posted to microsoft.public.access.queries
Sam
external usenet poster
 
Posts: 855
Default where clause

I am trying to view records where the date value of one control equals that
of another. The following clause causes an error:

WHERE DateValue([TimeStart])=DateValue([DateAppointment]);

How can I modify this to work properly?
Thanks
Sam

  #2  
Old November 7th, 2009, 09:19 PM posted to microsoft.public.access.queries
Ken Snell
external usenet poster
 
Posts: 177
Default where clause

What error do you see?
--

Ken Snell
http://www.accessmvp.com/KDSnell/



"Sam" wrote in message
...
I am trying to view records where the date value of one control equals that
of another. The following clause causes an error:

WHERE DateValue([TimeStart])=DateValue([DateAppointment]);

How can I modify this to work properly?
Thanks
Sam



  #3  
Old November 7th, 2009, 09:31 PM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default where clause

On Sat, 7 Nov 2009 12:46:01 -0800, Sam wrote:

I am trying to view records where the date value of one control equals that
of another. The following clause causes an error:

WHERE DateValue([TimeStart])=DateValue([DateAppointment]);

How can I modify this to work properly?
Thanks
Sam


For one thing, Queries reference fields in tables, unless you have a full
Forms!FormName!Controlname reference to refer to a control on a form; for
another, DateValue() will give an error if its argument is NULL.

What's the context? Are TimeStart and DateAppointment fields in your table,
controls on a form, or one of each? Might either be NULL?
--

John W. Vinson [MVP]
  #4  
Old November 9th, 2009, 03:44 AM posted to microsoft.public.access.queries
Duane Hookom
external usenet poster
 
Posts: 7,177
Default where clause

When suggesting there is an error, always provide the error and/or results.

Why are you mentioning "control"? Are TimeStart and DateAppointment both
date values? Are either of them Null?


--
Duane Hookom
Microsoft Access MVP


"Sam" wrote:

I am trying to view records where the date value of one control equals that
of another. The following clause causes an error:

WHERE DateValue([TimeStart])=DateValue([DateAppointment]);

How can I modify this to work properly?
Thanks
Sam

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.