Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f7F42qP39402 for ; Wed, 15 Aug 2001 00:02:52 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f7F3ogb38585 for pgsql-sql@postgresql.org; Tue, 14 Aug 2001 23:50:42 -0400 (EDT) (envelope-from news) From: "Bill" X-Newsgroups: comp.databases.postgresql.sql Subject: Re: DateDiff, IsNull? Date: Wed, 15 Aug 2001 11:44:01 +0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 45 Message-ID: <9lcrih$15lk$1@news.tht.net> References: X-Complaints-To: scrappy@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 To: pgsql-sql@postgresql.org X-Archive-Number: 200108/202 X-Sequence-Number: 4434 > Bill, > > > I am a newbie to postgreSQL, is it possible to write a "DateDiff", > > "IsNull" function work same as the one in SQL Server and are there > > and > > sample out there? > > I take it that you want to do this to port an exisiting application? > > If so, the DateDiff thing has already been covered in Roberto Mello's > "cookbook". > > However, ISNULL, last I checked, was a Microsoft Access function and not > supported by MS SQL Server. If you're porting from MS Access, you'll > need to fix a lot more of your SQL than the functions. There is, > however, help for MS Access users: > (for both of the above) > http://techdocs.postgresql.org/ I need to port a application that run on MS SQL Server/ Sybase SQL Anyway to postgreSQL, the 2 function list about is the one used most in the application I don't know when MS SQL Server being to have the funtion IsNull, but it exist from ver. 6.5 and up, and the syntax is IsNull( field_name, default_value), and will return the default_value when field is null > > And is it possible to override the existing > > function and > > operator like "+" to become a concate? > > How's your C porgramming? It's an open-source database, you can do > anything for which you have the skill and the time. The advisability of > doing so, however, is another thing entirely ... > > Given that all of the MS SQL Server "peculiarities" are not ANSI SQL > standard, have you given any thought to porting by search-and-replace > script instead of trying to make Postgres support a bunch of > non-standard operators and functions? It'd be easier. Yup, I also think it is easier, but it is an order Thanks for your help Bill