Re: Update Status Field after Expiry Date



Thanks to CELKO for being so critical.

1) It is pretty obvious that this cannot be the design for my actual
table, this was to simplify the post.

CREATE TABLE Customers -- plutal names for sets, please
( cust_id char(10)
Thanks again from the "newbie"


You need to fix that at once and teach the guy that SQL has no BOOLEAN data types -- that is just sooooo >fundamental!
Did not know that.

Yes and no. It's optional, so *of course* every major implementation
deals with it differently.

http://troels.arvin.dk/db/rdbms/#data_types-boolean
To CELKO : Would want your comments on this for "MS SQL Server"

Change accountStatus to

accountStatus AS (CASE WHEN accountExpirydate < getdate()
THEN convert(bit, 1)
ELSE convert(bit, 0)
END)

Works Great!!! However, I would go with CELKO's view solution. I have
to create a VIEW on that table anyways.


To CELKO:- You could have conveyed the message better by being a less
rude :(

.



Relevant Pages

  • Re: file access - design thoughts.
    ... But the stream can return an error state, because it does IO, and the ... Moving the processing to the IO *greatly* simplified the entire design and implementation. ... It also breached other "design rules" in order to simplify it greatly. ...
    (comp.lang.c)
  • Re: file access - design thoughts.
    ... Moving the processing to the IO *greatly* simplified the entire design and implementation. ... It also breached other "design rules" in order to simplify it greatly. ... There is more than one approach and separating the IO from the logic is not always the correct approach. ... complify things, and break the rule KISS, by using ggets. ...
    (comp.lang.c)
  • Re: select * from (select * from bob) and other easy stuff
    ... If you have the views to simplify the logic then the BI tools should be ... that big with a bad design. ... Instead BI tooling produces these queries. ... based on whatever some business user came up with today. ...
    (comp.databases.informix)
  • Re: file access - design thoughts.
    ... Moving the processing to the IO *greatly* simplified the entire design and implementation. ... It also breached other "design rules" in order to simplify it greatly. ...
    (comp.lang.c)
  • Re: Layouter / Resizer ?
    ... of resolution independance and to simplify the design ... My requirements are not very clear in my minds, ... I would like to simplify the design of forms which are ...
    (borland.public.delphi.thirdpartytools.general)