user13541818
user13541818

Reputation:

Format String doesn't match literal

I'am translating MySQL query to Oracle/SQL and since I don't have enought experience in Oracle/SQL this kind of error is unclean for me.

ORA-01861: literal does not match format string
01861. 00000 -  "literal does not match format string"
*Cause:    Literals in the input must be the same length as literals in
           the format string (with the exception of leading whitespace).  If the
           "FX" modifier has been toggled on, the literal must match exactly,
           with no extra whitespace.
*Action:   Correct the format string to match the literal.

And my work is here

   SELECT * FROM 
                (SELECT p.ProjectID, p.CustomName, p.Name
                        FROM projects  p
                        INNER JOIN 
                            users u
                        ON
                            u.UserID =  193
                        WHERE 
                            u.User_roleID = 1
                    UNION
                    SELECT p.ProjectID, p.CustomName, p.Name 
                        FROM projects  p
                        WHERE 
                            (p.Responsible_person_id = 193 OR p.Delivery_contact = 193) 
                        AND 
                            (SYSDATE BETWEEN to_date(p.StartDate) AND to_date(p.EndDate))
                        AND 
                            p.status = 2
                    UNION
                    SELECT rs.ProjectID, pr.CustomName, pr.Name 
                        FROM 
                            responsible_persons  rs
                        LEFT JOIN 
                            projects  pr 
                        ON 
                            pr.ProjectID = rs.ProjectID
                        WHERE 
                            rs.UserID = 193
                        AND 
                            (SYSDATE BETWEEN to_date(pr.StartDate) AND to_date(pr.EndDate))
                        AND 
                            pr.status = 2
                    UNION
                    SELECT p.ProjectID, p.CustomName, p.Name 
                        FROM project_users_schedule_dates pusd
                        LEFT JOIN projects p 
                        ON
                            p.ProjectID = pusd.ProjectID
                        WHERE pusd.UserID = 193
                        AND
                           (SYSDATE BETWEEN to_date(pusd.StartDate) AND to_date(pusd.EndDate+1))                    
                        AND p.status = 2) a
                --GROUP BY a.ProjectID
                ORDER BY a.CustomName, a.ProjectID

So far I check line-by-line and I can not see what is wrong here.

What I miss here ? Where the error comes from ?

Upvotes: 0

Views: 108

Answers (0)

Related Questions