473,287 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Timestamps in Views

Hi,
I use a data formatting in views (to_char(last_update, 'YYYY-MM-DD
HH:MM:SS') as last_update and noticed that the last update returned is
the creation date of the view or not the actual value of the
last_update.(last _update is a timestamp).

What do I need to do to display the actuall value?

Thanks
Alex


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #1
3 1140
On Thursday 23 October 2003 09:07, Alex wrote:
Hi,
I use a data formatting in views (to_char(last_update, 'YYYY-MM-DD
HH:MM:SS') as last_update and noticed that the last update returned is
the creation date of the view or not the actual value of the
last_update.(last _update is a timestamp).


It doesn't sound likely - could you provide the view definition and a couple
of lines of output?

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org

Nov 12 '05 #2
Richard,
have a look I also don't quite understand why it is happening.
The dates returned are actually not the creation date of the view but just a different date.
Thanks
Alex

# drop view view_joblog;
DROP VIEW
# CREATE VIEW view_joblog AS
# SELECT log_id AS lid,job_id AS jid, job_type AS jtype, to_char(job_start, 'YYYY-MM-DD HH:MM:SS') AS job_start,to_char(job_end, 'YYYY-MM-DD HH:MM:SS') AS job_end,job_status AS jstat,
# log_file AS log_file, pid FROM job_log ORDER BY log_id;
CREATE VIEW
# select * from view_joblog where lid=530;
-[ RECORD 1 ]---------------------------------
lid | 530
jid | 198
jtype | 21
job_start | 2003-10-07 10:10:28
job_end | 2003-10-07 10:10:05
jstat | 4
log_file | clientfiles-21-20031007-103928.xml
pid | 30724

# select log_id,job_id,job_type,job_start,job_end,job_statu s,log_file,pid FROM job_log where log_id=530;
-[ RECORD 1 ]----------------------------------
log_id | 530
job_id | 198
job_type | 21
job_start | 2003-10-07 10:39:28.172914
job_end | 2003-10-07 10:42:05.140341
job_status | 4
log_file | clientfiles-21-20031007-103928.xml
pid | 30724

Richard Huxton wrote:
On Thursday 23 October 2003 09:07, Alex wrote:

Hi,
I use a data formatting in views (to_char(last_update, 'YYYY-MM-DD
HH:MM:SS') as last_update and noticed that the last update returned is
the creation date of the view or not the actual value of the
last_update.(last _update is a timestamp).


It doesn't sound likely - could you provide the view definition and a couple
of lines of output?


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 12 '05 #3
On Friday 24 October 2003 02:13, Alex wrote:
Richard,
have a look I also don't quite understand why it is happening.
The dates returned are actually not the creation date of the view but just
a different date. Thanks # SELECT log_id AS lid,job_id AS jid, job_type AS jtype,
to_char(job_start, 'YYYY-MM-DD HH:MM:SS') AS job_start,to_char(job_end, job_start | 2003-10-07 10:10:28


Ah! got it - you're using MM for month and minute. It'll be "m" or "i" or
something.

I've done the same, and looked at the code 100 times without noticing it.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #4

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

Similar topics

7
by: lkrubner | last post by:
This might be an idiot question, but how do you group by timestamps by date? I mean, given a large number of timestamps, spanning many months, how do grab them and say how many are from each day?...
10
by: Craig Wahlmeier | last post by:
Am I the only one in the world that selects dates and timestamps with OLEDB? V8 of UDB has brought me a big problem. The PATCH2=24 setting no longer works the way it used to. The settings of...
5
by: Robert Schuldenfrei | last post by:
Dear NG, I have not heard from anyone about a good book that deals with the concurrency issue in SQL Server using C#. I have PROMISED Nick I would not use record locking and I have used an old...
2
by: Chumma Dede | last post by:
Hi, I need to code a DLL in .NET which logs the response times for our asp.net multi-tier application. The problem is we need to log the timestamps at multiple stages in a process lifecycle...
4
by: Craig G | last post by:
im not too sure how i should be storing the SQL2000 timestamps basically i return a dataset which is used to populate an editable grid. this dataset contains the timestamp. how should i be...
1
by: Erwin Van de Velde | last post by:
Hi, I'm building a central logging system for security applications as my master thesis, but I've run into some troubles: Different applications make database logs using different formats: -...
3
by: rAinDeEr | last post by:
Hi, Is there any performance issues related to having default timestamps in tables? I have a Data Model in which all the tables have created_tms and last_updated_tms which I have set default...
0
by: mikek | last post by:
Good Morning from Detroit, I am working on a project to Connect and manipulatee data in a SQLServer Data base, from a LINUX server using PERL. and SOAP We decided to use SOAP:Lite. (there are...
6
by: xkenneth | last post by:
All, Just a quick question. I want to be able to have a data structure that organizes data (timestamps I'm working with) sequentially, so that i can easily retrieve the first x amount of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.