473,385 Members | 1,764 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,385 software developers and data experts.

view puzzle

Here's what I want to do.

I want a view that restricts to rows that are "in date" when a
working date exists, but shows the whole table when no date exists.

I have a temporary global work-items table that has a single row
including the working date as one column. This is scrubbed when
the connetion to the database is closed. But some automated
processes will connect and not put an entry into the work items
table. There will be zero rows in the table.

Is there a not-too-complicated way to construct a view that
restricts by a date when there is one, but does not restrict
when there is no date?

Restricting to the date is pretty simple when it's there. It's
just a select statement that has start_date <= working_date
and end_date >= working_date. But how do I procede when there
is no working date?
Socks
Jul 19 '05 #1
3 1993
pu*********@hotmail.com wrote in message news:<c7**************************@posting.google. com>...
Here's what I want to do.

I want a view that restricts to rows that are "in date" when a
working date exists, but shows the whole table when no date exists.

I have a temporary global work-items table that has a single row
including the working date as one column. This is scrubbed when
the connetion to the database is closed. But some automated
processes will connect and not put an entry into the work items
table. There will be zero rows in the table.

Is there a not-too-complicated way to construct a view that
restricts by a date when there is one, but does not restrict
when there is no date?

Restricting to the date is pretty simple when it's there. It's
just a select statement that has start_date <= working_date
and end_date >= working_date. But how do I procede when there
is no working date?
Socks

offhand, I cannot think of how the final version will work, but AFAIK
if "there is no working date", then your WHERE clause will test for
NULL, IOW,
WHERE working_date IS NULL

Hmm, will the final complete SQL view contain a NOT IN clause??

HTH
ed
Jul 19 '05 #2
ed********@magicinterface.com (Ed prochak) wrote in message news:<4b**************************@posting.google. com>...
[snip]
Hmm, will the final complete SQL view contain a NOT IN clause??


That will work. Yes, select all the ones that are not in the
set excluded by the date.

Thanks.
Socks
Jul 19 '05 #3
> Restricting to the date is pretty simple when it's there. It's
just a select statement that has start_date <= working_date
and end_date >= working_date. But how do I procede when there
is no working date?


What's wrong with:
where working_date is null or working_date between start_date and end_date
Or with this:
where nvl(working_date,start_date) between start_date and end_date

Of course, I assume start_date and end_date cannot be NULL...

HTH
Flado
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Earl Teigrob | last post by:
I am building a custom control that I want to server as a container for child controls that can be dynamically added to this control. I can persist the child controls that are added to my custom...
0
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
1
by: xavier vazquez | last post by:
I have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of...
0
by: xavier vazquez | last post by:
have a problem with a program that does not working properly...when the program run is suppose to generate a cross word puzzle , when the outcome show the letter of the words overlap one intop of the...
5
by: ashish0799 | last post by:
HI I M ASHISH I WANT ALGORYTHMUS OF THIS PROBLEM Jigsaw puzzles. You would have solved many in your childhood and many people still like it in their old ages also. Now what you have got to do...
3
by: oncue01 | last post by:
Word Puzzle Task You are going to search M words in an N × N puzzle. The words may have been placed in one of the four directions as from (i) left to right (E), (ii) right to left (W), (iii) up...
1
by: float | last post by:
Hello all, I have an application I have written in VB that utilizes the web browser control. Users can access webpages with it but also scan folders on their computer. Here is my question...
3
by: puppet_sock | last post by:
Here's what I want to do. I want a view that restricts to rows that are "in date" when a working date exists, but shows the whole table when no date exists. I have a temporary global...
4
by: honey777 | last post by:
Problem: 15 Puzzle This is a common puzzle with a 4x4 playing space with 15 tiles, numbered 1 through 15. One "spot" is always left blank. Here is an example of the puzzle: The goal is to...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.