If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Informix > Query to find first sunday in a given month?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-06-04, 17:36
savrao savrao is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
Query to find first sunday in a given month?

Hi

I am new to informix,
I want to find date of first sunday on a given month, we have next_day function in oracle, is there any funtion like this in informix?
sql query which return the date of first sunday will be help full.

thanks
ashok
Reply With Quote
  #2 (permalink)  
Old 04-13-04, 16:45
fprose fprose is offline
Registered User
 
Join Date: Apr 2003
Location: Phoenix, AZ
Posts: 177
There is no function to do this but you can use the WEEKDAY() function and derive the value. For example:

select first 1 case weekday('03/01/2004')
when 0 then 1
else (8 - weekday('03/01/2004'))
end
from systables;

The date you would supply is the 1st of the month in question.
__________________
Fred Prose
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On