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  

"If - Then" Return These Records



 
 
Thread Tools Display Modes
  #1  
Old January 14th, 2007, 07:04 PM posted to microsoft.public.access.queries
BM
external usenet poster
 
Posts: 32
Default "If - Then" Return These Records

I have a query based off of two tables. There are date fields in each of the
tables (class date and enroll date). The query includes each of the date
fields. I tried to do a criteria that would only display those records where
the enroll date was greater than the class date. I couldn't get anything to
return even though some dates in the enroll date fields were greater than
those in the class dates. Is there something I need to do because they are
time/date fields? Could I build an expression in another field in the query
that said "IF enroll date class date THEN display the text "need to enroll"?
  #2  
Old January 14th, 2007, 07:11 PM posted to microsoft.public.access.queries
Rick Brandt
external usenet poster
 
Posts: 4,354
Default "If - Then" Return These Records

BM wrote:
I have a query based off of two tables. There are date fields in
each of the tables (class date and enroll date). The query includes
each of the date fields. I tried to do a criteria that would only
display those records where the enroll date was greater than the
class date. I couldn't get anything to return even though some dates
in the enroll date fields were greater than those in the class dates.
Is there something I need to do because they are time/date fields?
Could I build an expression in another field in the query that said
"IF enroll date class date THEN display the text "need to enroll"?


Post your query. A basic greater than or less than should work fine here...

SELECT *
FROM TableName
WHERE [class date] [enroll date]

These ARE actual DateTime fields right? Not text fields containing strings that
look like dates?

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 




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 09:30 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.