473,407 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

If then statement in reports

I have a simple database tracking a vacation schedule. All I have is 3 tables and so far 1 form other then the switchboard. In the main table I have leaving date and returning date fields. Basicly I want a report that only shows who is currently on vacation.


Thank You
Josh
Nov 26 '06 #1
4 1959
Killer42
8,435 Expert 8TB
I have a simple database tracking a vacation schedule. All I have is 3 tables and so far 1 form other then the switchboard. In the main table I have leaving date and returning date fields. Basicly I want a report that only shows who is currently on vacation.
That should be pretty simple. Just design your report, and for the data source give it something like the following query
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM Table1
  2.   WHERE ([Leaving] <= Date() AND [Returning] >= Date())
You might even get away with something like
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM Table1 WHERE (Date Between [Leaving] AND [Returning])
I can never remember whether you need the parentheses on the Date function, sorry.
Nov 26 '06 #2
NeoPa
32,556 Expert Mod 16PB
You might even get away with something like :
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM Table1 WHERE (Date Between [Leaving] AND [Returning])
You should certainly be looking to use this format.

I can never remember whether you need the parentheses on the Date function, sorry.
Generally not. I always advise to use them, however, as it gives a visual clue to a code reader that you are referring to a function call rather than a variable or a field in your dataset.
Nov 26 '06 #3
Killer42
8,435 Expert 8TB
I can never remember whether you need the parentheses on the Date function, sorry.
Generally not. I always advise to use them, however, as it gives a visual clue to a code reader that you are referring to a function call rather than a variable or a field in your dataset.
Good advice - thanks.
Nov 26 '06 #4
Thank you guys for the advice, I will give it a try!!
Dec 7 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Michelle | last post by:
I have tried every variation of the "onchange" statement below without any actual reloading of the page. I am hoping that the PHP PRINT statement is constructed wrong, otherwise it is javaScript...
2
by: JS | last post by:
I have v8.1 fix5 using Win2k AS on 7 node logical system. I create event monitor writing to file and turn it on. Using application, I connect to db and navigate from screen to screen, generating...
2
by: Richard Holliingsworth | last post by:
Hello: How do you attac an SQL statement to an unbound forms (or reports) control in A2002? I created an unbound text box, and I want to attach the following SQL statement..... select...
5
by: WindAndWaves | last post by:
Hi Team The function below searches all the tables in a database. However, if subsearch = true then it searches all the objects listed in a recordset (which are all table names). I thought to...
1
by: BerkshireGuy | last post by:
The following statement works in Access 2000, but when I run the same database in Access 2003, I get a #Num! error. =IIf(IsError(!!!),0,!!!)/IIf(IsError(!!!),1,!!!) Any ideas? Thanks, ...
4
by: Anja | last post by:
Hi everyone, I am trying to use the expression builder to create input to a control in an Access report. I have a table called Records and I want to select the minimum date for a record where...
1
by: mycall | last post by:
Heyyas. I am trying to print out a report which lists account details and payment amounts from january to december. I have following tables: Payment(paymentNo, DateOwing, amount, accountID)...
1
by: teneesh | last post by:
I'm not very clear on the synax when creating a CASE statement in Access. Please take a look at this and guide me on the appropriate syntax please. Thanks Private Sub txtCount_Exit(Cancel As...
0
by: angi35 | last post by:
In Access 2000, I'm trying to create a couple reports but can't figure out the queries. 1. In a form, I have a control with a dollar amount, with the source field . Then there's an option group...
14
by: MNNovice | last post by:
My main report contains 3 separate expense sub reports. For my sub report footers I used (one of the sub report shown here) I have this statement =IIf(IsNull(),0,Sum()) My goal is to show a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.