Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Microsoft Access
»
Microsoft Access
»
select statement
select statement
Rate Topic
Display Mode
Topic Options
Author
Message
Frances L
Frances L
Posted Wednesday, October 29, 2008 1:01 PM
Old Hand
Group: General Forum Members
Last Login: Sunday, September 18, 2011 6:11 PM
Points: 355,
Visits: 299
I have table in MS ACCESS:
has hire_date, rehired_Date, Termination_Date.
I want to
select rehired_date as hire_date when terminate_date
How to write this statement ?
ig:
hired_date as 10/1/07
termination date 10/03/07
rehired_date 10/2/08
then the hired_date will outcome as 10/02/08
hired_date as 10/1/07
termination date 10/02/07
rehired_date null
then the hired_date will outcome as 10/01/07
hired_date as 10/1/07
termination date 10/03/07
rehired_date is 10/02/07
then the hired_date will outcome as 10/02/07
Thx.
Post #593878
Lynn Pettis
Lynn Pettis
Posted Wednesday, October 29, 2008 1:09 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:52 PM
Points: 21,635,
Visits: 27,495
Frances L (10/29/2008)
I have table in MS ACCESS:
has hire_date, rehired_Date, Termination_Date.
I want to
select rehired_date as hire_date when terminate_date
How to write this statement ?
ig:
hired_date as 10/1/07
termination date 10/03/07
rehired_date 10/2/08
then the hired_date will outcome as 10/02/08
hired_date as 10/1/07
termination date 10/02/07
rehired_date null
then the hired_date will outcome as 10/01/07
hired_date as 10/1/07
termination date 10/03/07
rehired_date is 10/02/07
then the hired_date will outcome as 10/02/07
Thx.
Not seeing termination date having anything to do with what is returned. Looks to like you want something like this:
select isnull(rehired_date, hired_date) from sometable
Lynn Pettis
For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here
or
when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here
and
here
Managing Transaction Logs
SQL Musings from the Desert
Fountain Valley SQL
(My Mirror Blog)
Post #593882
Matt Miller (#4)
Matt Miller (#4)
Posted Wednesday, October 29, 2008 3:18 PM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 8:43 PM
Points: 6,998,
Visits: 13,952
If you're using natve Access queries - you will need to use the NZ function instead of the ISNULL function Lynn mentioned (ISNULL is something different in Access).
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Post #593967
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.