Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2010
    Posts
    14

    Red face Unanswered: concatenation of date with year and month

    hi guys,
    i want to concatenate date with year and month.
    for example 'yyyy-mm' is already there i want to concatenate with my coded value that is 25. me doin like 'yyyy-mm'||'-25'. its nt running..ny1m please can u provide soln ?

    tahnks

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by sahendramansingh View Post
    its nt running..
    That is not a valid Postgres error message.
    ny1m
    Sorry, what's a "ny1m"?

    soln
    Sorry, what's a "soln" (I know it's a suburb of Munich, but I'm 100% sure you don't mean that....)

    For future posts:

    - post the definition of your tables (preferrably as CREATE TABLE)
    - post the complete SQL statement that you are running (copy & paste)
    - post the complete error message that you get (copy & paste)
    - Please try to write proper english. Using unknown abbreviations makes it hard for non-native speakers to understand you.

  3. #3
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    Code:
    SELECT to_char(mydate, 'YYYY-MM') || '-25' AS text_value, 
    date_trunc('MONTH', mydate)::date + 24 AS date_value

  4. #4
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    Oh shammat, you're so not L33t.
    its nt running
    He's saying its not running. But his "O" key is broke.

    ny1m
    Here he's saying that he is really frustrated that it doesn't work and demonstrates that by mashing random keys on the key board.

    please can u provide soln
    He's asking if you can provide a solution. But now his "O" key works and the "shun" key is broken.

    tahnks
    Here he expresses his gratitude for your help. He feels that his keen eye and close attention to detail will make him an excellent programmer and looks forward to working with you in the future.
    Last edited by artacus72; 08-09-10 at 12:59.

  5. #5
    Join Date
    Aug 2010
    Posts
    14

    @arca - thanks..

    bt its nt working yaar. please let me know in details step bt step buddy, if possible..im new to dis dept. (

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by sahendramansingh View Post
    bt its nt working yaar.
    - post the definition of your tables (preferrably as CREATE TABLE)

    - post the complete SQL statement that you are running (copy & paste)

    - post the complete error message that you get (copy & paste)

    - please use proper english, not leetspeak
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Quote Originally Posted by sahendramansingh View Post
    nt working yaar
    What's an "nt working yaar"?
    Anything to do with the uptime of a Windows NT system?

Posting Permissions

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