473,803 Members | 3,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update Status Field after Expiry Date

Consider the following table

Customer
custId char(10)
accountExpiryDa te datetime
accountStatus bit

Now, I want to update the accountStatus to False as soon as the
current date becomes accountExpiryDa te.

I think it can be done using "SQL Agent" but my webhost doesnt provide
me access to that. I have access only to the Query Analyzer.

Thanks
Shane

Mar 26 '07
12 4704
Hugo Kornelis wrote:
On Thu, 29 Mar 2007 18:08:00 -0700, Ed Murphy wrote:
>--CELKO-- wrote:
>>All data types have to be NULL-able in SQL. Having a BOOLEAN type
would lead to 4 valued logic with inconsistent rules about how NULLs
propagate. And the various vendor extension do not work or port
either.
It seems like dropping UNKNOWN would leave a sensible set of rules:

and | T N F or | T N F not |
----+------ ---+------ ----+--
T | T N F T | T T T T | F
N | N N F N | T N N N | N
F | F F F F | T N F F | T

Am I overlooking anything?

Hi Ed,

You've overlooked the basic rule of NULL propagation: any expression
involving NULL results in NULL. In the tables above, there are
exceptions to this rule, such as NULL AND FALSE resulting in FALSE, and
TRUE OR NULL resulting in TRUE.
That rule is oversimplified. Really, it should be "any expression
whose value _depends_ on a NULL input results in NULL", i.e. could
replacing the NULL with different non-NULL values lead to different
values of the expression? NULL + 2 qualifies; NULL = 'ABC' qualifies;
but NULL AND FALSE does not, and neither does TRUE OR NULL.

(As usual, IS NULL and IS NOT NULL remain special cases.)
Apr 6 '07 #11
>It seems like dropping UNKNOWN would leave a sensible set of rules:

and | T N F or | T N F not |
----+------ ---+------ ----+--
T | T N F T | T T T T | F
N | N N F N | T N N N | N
F | F F F F | T N F F | T

Am I overlooking anything? <<

The NULL propagation rule.

and | T N F or | T N F not |
----+------ ---+------ ----+--
T | T N F T | T N T T | F
N | N N N N | N N N N | N
F | F N F F | T N F F | T

This means that TRUE OR NULL = NULL, etc. and you can now prove that
TRUE = FALSE. The UNKNOWN logical value does not have this behavior
and that is why we have it.

Apr 8 '07 #12
--CELKO-- wrote:
>>It seems like dropping UNKNOWN would leave a sensible set of rules:

and | T N F or | T N F not |
----+------ ---+------ ----+--
T | T N F T | T T T T | F
N | N N F N | T N N N | N
F | F F F F | T N F F | T

Am I overlooking anything? <<

The NULL propagation rule.

and | T N F or | T N F not |
----+------ ---+------ ----+--
T | T N F T | T N T T | F
N | N N N N | N N N N | N
F | F N F F | T N F F | T

This means that TRUE OR NULL = NULL, etc. and you can now prove that
TRUE = FALSE. The UNKNOWN logical value does not have this behavior
and that is why we have it.
NULL represents the concept "unknown" in all other contexts; it should
represent it in the context of the Boolean data type as well.

IINM, while SQL doesn't have a mandatory Boolean *type*, it already
follows TRUE OR NULL = TRUE and FALSE AND NULL = FALSE in Boolean
*expressions*. Example:

CREATE TABLE Table1 (Column1 varchar(10), Column2 varchar(10))

INSERT INTO Table1 (Column1, Column2) values ('A' , null)
INSERT INTO Table1 (Column1, Column2) values (null, 'B' )

SELECT * FROM Table1 WHERE Column1 = 'A' OR Column2 = 'B'
-- returns 2 rows

SELECT * FROM Table1 WHERE Column1 = 'A' AND Column2 = 'B'
-- returns 0 rows
Apr 8 '07 #13

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

Similar topics

3
2018
by: Mohammed Mazid | last post by:
Can anyone please help me here? Basically I have modified the source code and understood it but when I update a record in the db using a JSP, it gives me an error "The flight you selected does exist." Althought there is not selection going on, instead it is entered, I need it to match the flight in the db using the flightNo. I want all the attributes to be changed apart from the flightNo itself as it is it's associated details I need...
2
19897
by: Vince C. | last post by:
Hi all. I'm trying to set a cookie expiry date but my script is JS (JavaScript). I've tried Response.Cookies("Test").Expires = Date(); Response.Cookies("Test").Expires = Date().toLocaleString(); Response.Cookies("Test").Expires = Date().toString(); Response.Cookies("Test").Expires = Date().toUTCString();
4
2860
by: ianv2 | last post by:
Hi Is the following possible using Javascript ? I would like a page to redirect to another page if the page expiry has passed. E.G. If my questionnaireform.html page had an expiry date of July 31, if I
4
10065
by: William Bradley | last post by:
I have two cells on a form. One of them is the "Production Date" and the other is the "Expiry Date". The "Expiry Date" is 183 days after the "Production Date." On an Excel spreadsheet, the "Expiry Date" is automatically entered, when the "Production Date" is entered. To do this the "Expiry Date" cell carries the following formula: "=A15+183". I would like to be able to do the same on an Access Form, with the results written to the...
2
3525
by: William Bradley | last post by:
"Marshall Barton" <marshbarton@wowway.com> wrote in message news:9as9lvgpnp783kogctb88c8giaepb5uf6g@4ax.com... > William Bradley wrote: > >I have two cells on a form. One of them is the "Production Date" and the >other is the "Expiry Date". The "Expiry Date" is 183 days after the >"Production Date." > >On an Excel spreadsheet, the "Expiry Date" is automatically entered, when >the "Production Date" is entered. To do this the "Expiry...
3
9271
by: hasanainf | last post by:
Hi all, What will be the best database design for an inventory control that uses expiry date for its products. Over a period of time, a particular product will have many expiry date and that one particular expiry date could have multiple products I am thinking of two approaches not knowing which one to go for. First design is of one product having many expiry dates (a one to many
3
2010
by: Melon via AccessMonster.com | last post by:
If anyone could take a look at this, I could do with the help. Im running into 2 problems with my db. 1) I have a members section in my db. If a member is selected as senior, all fields apply to him, if a member is selected as junior, other fields don't apply and I need to be able to hide them. 2) I have a date joined field, there is an expiry date field, which is date
11
1852
by: John | last post by:
Hi I had a working vs 2003 application with access backend. I added a couple fields in a table in access db and then to allow user to have access to these fields via app I did the following; 1. Regenerated the data adapter sqls by running the data adapter wizard and pasting the resulting code into my app. 2. Deleted the data adapter correspond to the relevant access table from the
0
1702
by: jon | last post by:
Hi there, I'm brand new to Access and may be trying to do too much too soon, but I wanted to get some expert advice on how the best way to go about what I am trying to accomplish would be. I am trying to modify the Microsoft Template at the following address (http://office.microsoft.com/en-us/templates/TC012186931033.aspx?CategoryID=CT101426031033) to work as an issues tracker that imports and updates the issues from a SQL 2005...
0
9566
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10555
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10300
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9127
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7607
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.