MS Access
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Tutorialized ForumsDatabasesMS Access

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 1st, 2007, 07:21 PM
izzyk izzyk is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 3 izzyk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 14 sec
Reputation Power: 0
Condition in where clause for default value

Hi

I have a form that takes in a year value and a month value, and feeds it back to a query which returns all transactions for that month in that year.

SELECT People.ID, People.Surname, People.[First Name], VisitHistory.Date, VisitHistory.[Amount collected], Months.Number, Months.Month, Year([Date]) AS [Year]
FROM Months, People INNER JOIN VisitHistory ON People.ID = VisitHistory.[Person ID]
WHERE (((Months.Number)=Month([Date])) AND ((Year([Date]))=[Forms]![Report menu]![Year]) AND ((Month([Date]))=[Forms]![Report menu]![Month]+1));

I want it to display all transactions for a year (i.e. all months) when no month has been selcted on the form?
How do i accompish this.

(Can one put an if statement in the where clause? - such as if no value returned back, select all)

Thanks

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesMS Access > Condition in where clause for default value


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway