473,783 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

To_char statement problems

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

Nov 23 '05 #1
2 2745
On Thu, Apr 08, 2004 at 19:07:04 -0000,
Jim Wilson <ji**@kelcomain e.com> wrote:

You are telling it HH:MM where MM is the Month.... so it is doing exactly
what you asked for.


And you want to use MI to get minutes.

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

Nov 23 '05 #2
Clark Endrizzi wrote:
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

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

Nov 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5684
by: Amin Schoeib | last post by:
Hi, Can somebody tell me why this query don't work when I use to_date Instead of to_char By using to_char: select to_char(last_day(cast(current_date - interval '1 month' as date)),'DD.MM.YYYY') ;
3
18395
by: Praveen | last post by:
Hi All, I have some procedures which written in Oracle. Now the requirement has come to convert those procedures into db2. I used IBM provided MTK tool to convert the procedures. The tool has given the syntax for TO_DATE function. When i tried to execute in db2 command line prompt, it says an error... db2 => select ORA8.TO_DATE(ORA8.TO_CHAR(CURRENT TIMESTAMP , 'mm-dd-yyyy'), 'mm-d
2
9238
by: Mark Hansen | last post by:
I'm trying to convert some schema creation scripts that were used on MS SQL Server to DB2 (v8.2) and have a problem with the following select statement (snippet) used for a view: SELECT col1, col2, timestamp-col1, TO_CHAR(timestamp-col1, 'HH24') FROM ...
3
2519
by: Wei Wang | last post by:
I get compile error for this code: for i in 1..arg_count-1 LOOP RAISE NOTICE quote_literal(to_char(i, ''9'')); END LOOP; where arg_count = 3. I tried RAISE NOTICE to_char(i, ''9''); as well.
0
1081
by: Clark Endrizzi | last post by:
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....
14
3528
by: Najib Abi Fadel | last post by:
Hi, i am using PostgreSQL 7.3.2 there's a bug for the date '2005-03-27' !!!!!!!!!!!!!!!!!!!!!!!!!!! SELECT to_char('2005-03-27'::date,'DD/MM/YYYY'); to_char ------------ 26/03/2005 (1 row)
0
1845
by: richasaraf | last post by:
Hi all, Please help me out... i want to convert the to_char into number format.... please let em know how to do it... for eg: i have a statement : to_char(p_number, 'S000000') this converts the number into proper format.... now i want to convert tht 'S000000' char back to the original number p_number..... Can anyone tell me how to do it please :confused: Thanks a lot
1
17236
by: Eitan M | last post by:
Hello, What is the equivalent function for : to_char (to_char is Oracle function) in access ? select to_char ( ...) from ... Thanks :)
0
2450
by: woodsc | last post by:
Hi all, I am trying to optimize the queries in my application. Is there a performance difference between (to_char(myDate,format) < myString) and (myDate < to_date(myString, format)). ex. Select * from myTable where (to_char(fieldDate, 'MM/DD/YYY') <= queryDate ) or Select * from myTable where (fieldDate <= to_date(queryDate, 'MM/DD/YYYY') ) assuming fieldDate is a date or timestamp field and queryDate is '01/01/2007', a...
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10083
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5379
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.