473,385 Members | 1,798 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,385 software developers and data experts.

Substract hour into a function

Hi, I need to substract a variable hour from a timestamp in PostgreSQL 8.2, I think I can use the following sentence

Expand|Select|Wrap|Line Numbers
  1. select '2007-05-14 12:36:47' + ('-5 hours'::reltime);
I try that line in console and works fine for my purposes, but I'm having troubles turning the '-5' into a parameter for a plpgsql function.

Do you have any recommendations about how this can be done?



PS: This is my first post, I hope I accomplish all the posting guidelines, any comment is welcome.
May 14 '07 #1
1 2018
michaelb
534 Expert 512MB
Welcome to the Forum!
Let's start with the code you've developed so far for your function.
Post it here; no matter how bad it can be at this point, we'll just use it as a launch pad.
May 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Hon Seng Phuah | last post by:
Hi all, I have a problem and have someone can help me. I want to substract a numerica from a string. For example: A string is: $line = RVW-30 {
4
by: Jean-Christophe Michel | last post by:
Hi, In a complex merging of two (non ordered) xml files i need to keep track of the elements of the second tree that were already merged with first tree, to copy only unused elements at the end....
7
by: developer | last post by:
I want to substract a number of month from a specific date. someone have a easy solution ? Thanks
3
by: CBN Media | last post by:
Hi, I need to calculate a date which is current date (Now) minus x days. I looked at DateTime, it has a fairly large number of methods to add something to a date, but for substracting is just...
2
by: mtech1 | last post by:
Access 2003 I need to create a query to view data by 3 - 24 hour shifts. Ex: There are 3 shifts, each shift is 24 hours starting at 0700 through 0700. Each shift is designated as A, B, or C. ...
9
by: valy | last post by:
hi all, how to open two images and then substract both together to get the different? the image will be a grayscale image. A sequence of image is stored in a folder. I want to open two images and...
1
by: George | last post by:
Hello........I have a problem adding up record entries with more than 24 hours when the fields are formatted as hour/minute (h:m). If the actual summed total of all records is greater than 24...
9
by: Francois Grieu | last post by:
Is it OK to substract two pointer-to-void ? Are they guaranteed to act as pointer-to-char ? I fail to find that discussed in ISO/IEC 9899:1999. In other words (hopefully), is the following...
5
by: hassanhundal007 | last post by:
In my table the field of DateTime name is TIN. In this field DATE and TIME are shown for date I pass this query: SELECT DAY(TIN) FROM SHIFT WHERE SHID = 1 Then the result is "10". So the same I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.