Somebody must have encountered this before... and there's probably a
make-shift/better/best way of doing this...
Thanks,
Sean
Here's a check constraint you can use, along with a suggestion
that having a column with the month after the mm/yy might also
be handy for verifying that a card is still valid.
create table CardExp (
i int identity(1,1),
expMonth datetime check (datepart(day,expMonth) = 1),
goodIfBefore as dateAdd(month,1,expMonth)
)
insert into CardExp(expMonth) values ('19990201')
insert into CardExp(expMonth) values ('20040918')
insert into CardExp(expMonth) values ('20030501')
select * from CardExp
go
drop table CardExp
Steve Kass
Drew University
http://vyaskn.tripod.com/programming_faq.htm
<b>How to get rid of the time part from the date returned by GETDATE
function?
</b>
We have to use the CONVERT function to strip the time off the date.
Any of the following commands will do this:
SELECT CONVERT(char,GETDATE(),101)
SELECT CONVERT(char,GETDATE(),102)
SELECT CONVERT(char,GETDATE(),103)
SELECT CONVERT(char,GETDATE(),1)
See SQL Server Books Online for more information on CONVERT function.
"Sean Sankey" <ssa...@adelphia.net> wrote in message news:<%dpV9.8135$Fj2.4...@news2.news.adelphia.net>...