473,324 Members | 2,178 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,324 software developers and data experts.

help with dates

35
Can you "add" a number of days to a date?

I know you can use sysdate and do calculations like (sysdate-7), but can you do this on a date ie (01/01/08 -7)?
Jan 11 '08 #1
1 1043
Dave44
153 100+
Can you "add" a number of days to a date?

I know you can use sysdate and do calculations like (sysdate-7), but can you do this on a date ie (01/01/08 -7)?
absolutely, you do it the same way you would to sysdate (which after all is just a date, it just happens to be the current date)

Expand|Select|Wrap|Line Numbers
  1. [159]SQL> select to_date('20071225','yyyymmdd') + 7 from dual;
  2.  
  3. TO_DATE('
  4. ---------
  5. 01-JAN-08
  6.  
  7. Elapsed: 00:00:00.03
  8. [159]SQL> create table t (col1 date);
  9.  
  10. Table created.
  11.  
  12. Elapsed: 00:00:00.10
  13. [159]SQL> insert into t values (sysdate - 25);
  14.  
  15. 1 row created.
  16.  
  17. Elapsed: 00:00:00.01
  18. [159]SQL> select * from t;
  19.  
  20. COL1
  21. ---------
  22. 17-DEC-07
  23.  
  24. Elapsed: 00:00:00.01
  25.  
Jan 11 '08 #2

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

Similar topics

5
by: duikboot | last post by:
Hi all, I'm trying to export a view tables from a Oracle database to a Mysql database. I create insert statements (they look alright), but it all goes wrong when I try to execute them in Mysql,...
2
by: Ian DeRock | last post by:
I'm fairly new to XML. As I can see it, XML is a way to organize data like in a table in a RDB, or the RDB itself. I have used XML in application data, but did not design the actual XML. I...
8
by: Shlomi Schwartz | last post by:
Hi all, Why do I get the folowing date when creating it like so: var d = new Date(2003,9,2); Wed Oct 1 23:00:00 UTC+0200 2003 Isent it soposed to be:
6
by: paii | last post by:
I have a table that stores job milestone dates. The 2 milestones I am interested in are "Ship Date" TypeID 1 and "Revised Ship Date" TypeID 18. All jobs have TypeID 1 only some jobs have TypeID 18....
5
by: Alicia | last post by:
Yes, but will that skip a week and group by the date for me? I basically wanted something that would do a count of the dates, then group them by their week name.. BEFORE: Resource Date ...
8
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have...
0
by: Brian Henry | last post by:
Ok I've never implemented a snap location before so I dont really know what im doing wrong here... anyways, I am making a custom slider control that takes dates as its values instead of integers......
2
by: mario | last post by:
Hi, I have verry big problem. I must write function using dates. This is a problem: I have some dates for example: 2006-01-01, 2006-02-05, 2006-10-15 etc. then some times: 20sec, 50sec, 45sec...
4
by: Steve Chow | last post by:
I was wondering if someone could help with my assignment. I've pretty done finished the work but cannot figure out why it only prints the last one added. Here is my code. The way things are done...
2
by: Bill | last post by:
I have a 200 record database that includes a date/time field, AnnivDate, for a wedding anniversary. AnnivDate has nulls and some incorrect year data. I have been creating the Access database...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.