Results 1 to 2 of 2

Thread: Oracle SQL - get previous weekday

  1. #1

    Thread Starter
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Oracle SQL - get previous weekday

    Code:
    SELECT
    INVOICE.APINVOICE,
    UIS_HISTORY.MODIFIED_BY_
    to_date(to_char(UIS_HISTORY.DATE_OF_CHANGE, 'MM/DD/YYYY HH:MI:SS AM'),'MM/DD/YYYY HH:MI:SS AM')
    FROM
     INVOICE,
     UIS_HISTORY
    WHERE
     ( UIS_HISTORY.INVOICE_SYS=INVOICE.INVOICE_SYS_ID )
    AND
    UIS_HISTORY.DATE_OF_CHANGE=to_date(IF datepart(sysdate,dp_weekday)=1 THEN sysdate-3 ELSE sysdate-1,,'MM/DD/YYYY HH:MI:SS AM')
    keeps saying missing right parenthesis!???

    so, do you see where? or is this all wrong
    Last edited by Static; May 11th, 2015 at 10:30 AM.
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Oracle SQL - get previous weekday

    Is it because you have two commas together near the end there? I'm not sure what PL SQL allows but I don't think that would be permitted in T-SQL.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width