Re: [SQL] Convert INT to INTERVAL?

2004-06-08 Thread Michael Chaney
On Fri, Feb 27, 2004 at 11:54:04AM -0500, Brian Knox wrote: > Is it possible within pl/pgsql, to convert an integer to an interval in > months? IE, if num_months is an INT set to 48, can it be converted to an > interval? select (1||' months')::interval; You should be able to replace the "1" wit

Re: [SQL] User defined types -- Social Security number...

2004-03-01 Thread Michael Chaney
On Sun, Feb 29, 2004 at 11:11:31PM -0500, Christopher Browne wrote: > The world rejoiced as [EMAIL PROTECTED] (Michael Chaney) wrote: > > Look, you're thinking way too hard on this. An SSN is a 9-digit number, > > nothing more. There are some 9-digit numbers which aren't

Re: [SQL] User defined types -- Social Security number...

2004-03-01 Thread Michael Chaney
On Mon, Mar 01, 2004 at 09:42:48AM -0800, Steve Crawford wrote: > I missed the start of this thread but will chime in with a comment > anyway. > > My rule is to select an appropriate numeric type of data if you will > be doing numeric types of things to it, character types if you will > be doin

Re: [SQL] User defined types -- Social Security number...

2004-02-29 Thread Michael Chaney
On Sun, Feb 22, 2004 at 04:45:51PM -0800, Greg Patnude wrote: > Thanks Josh -- I understand that there are valid and invalid SSN's -- > similar rules apply to zip codes and area codes... > > I tried this: > > SELECT to_char(123456789, '000-00-'); > which yields 123-45-6789 -- nicely, I might ad

Re: [SQL] Postgres DB

2004-02-29 Thread Michael Chaney
On Mon, Feb 23, 2004 at 02:24:32PM +0530, Sumita Biswas wrote: > The following Query string , when executed does not give an Error, even > though the table Tbl_Billing_Data is not present. > > QueryToPopulateTemp := ''INSERT INTO Tmp_Conference(ConferenceType, > CallManagerId, ClusterId, DestConve

Re: [SQL] Last day of month

2004-02-26 Thread Michael Chaney
On Thu, Feb 26, 2004 at 03:07:52AM -, Greg Sabino Mullane wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > > How to find the last sunday/mon/sat of any given month. > > There is probably a smoother way to do it, but here is a > quick little function to do what you ask