You are here: Re: Update Status Field after Expiry Date « MsSQL Server « IT news, forums, messages
Re: Update Status Field after Expiry Date

Posted by Ed Murphy on 03/27/07 04:57

--CELKO-- wrote:

> Notice I dropped the redundant BIT column. Some newbie actually used
> a proprietary, low-level BIT data type. You need to fix that at once
> and teach the guy that SQL has no BOOLEAN data types -- that is just
> sooooo fundamental!

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

> CREATE VIEW ActiveCustomers (..)
> AS
> SELECT cust_id, acctexpiry_date, ..
> FROM Customers
> WHERE CURRENT_TIMESTAMP < acctexpiry_date;

If the expiration date is "expires after this date" rather than "expires
on this date", then change the WHERE clause to

WHERE CURRENT_TIMESTAMP < DateAdd(dd, 1, acctexpiry_date);

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация