sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Clark Endrizzi's Avatar

To_char statement problems


Question posted by: Clark Endrizzi (Guest) on November 23rd, 2005 12:29 AM
I just sent this twice before with the wrong email address so it didn't
go through, that is why I am sending this so that it will get through.
I hope this isn't causing issues.

Hi guys. I certainly hope this is the correct place to email this. I'm
having an issue that I have really tried to solve but can't.

I'm using RHEL's postgresql 7.3.4 and everything works great except my
to_char() statements. The most common conversion string I use is
'MM/DD/YYYY HH:MM AM' which works except the minutes are never correct,
they always end with ":04". So if I submitted it at 10:23 AM it will
say 10:04 after conversion.

I know Redhat doesn't have the newest version but I can't believe that
they would have such a big problem. Is this just a problem in this
version? Is my syntax incorrect?

Thanks!
--
Clark Endrizzi
NAI Utah Commercial Real Estate
801-578-5522

2 Answers Posted
Bruno Wolff III's Avatar
Guest - n/a Posts
#2: Re: To_char statement problems

On Thu, Apr 08, 2004 at 19:07:04 -0000,
Jim Wilson <jimw@kelcomaine.com> wrote:[color=blue]
>
> You are telling it HH:MM where MM is the Month.... so it is doing exactly
> what you asked for.[/color]

And you want to use MI to get minutes.

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Ron St-Pierre's Avatar
Guest - n/a Posts
#3: Re: To_char statement problems

Clark Endrizzi wrote:
[color=blue]
> I just sent this twice before with the wrong email address so it
> didn't go through, that is why I am sending this so that it will get
> through. I hope this isn't causing issues.
>
> Hi guys. I certainly hope this is the correct place to email this.
> I'm having an issue that I have really tried to solve but can't.
>
> I'm using RHEL's postgresql 7.3.4 and everything works great except my
> to_char() statements. The most common conversion string I use is
> 'MM/DD/YYYY HH:MM AM' which works except the minutes are never
> correct, they always end with ":04". So if I submitted it at 10:23 AM
> it will say 10:04 after conversion.
>
> I know Redhat doesn't have the newest version but I can't believe that
> they would have such a big problem. Is this just a problem in this
> version? Is my syntax incorrect?
>
> Thanks!
>
>--
>Clark Endrizzi
>NAI Utah Commercial Real Estate
>801-578-5522
>[/color]
You're telling it to give you month/day/year hour:month am[pm]

Use MI for minutes instead of MM.

Ron


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

 
Not the answer you were looking for? Post your question . . .
196,952 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,952 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors