How to add number of years to date
Hello,
How can I add a number of years (age) to a date (not the current date, the birth date, chosen from a DatePicker).
Thank you,
Ioana.
Wow, that was fast :)
Sorry for the double post, wasn't sure the first one was published.
Thanks a lot, I've managed to add the the age correctly.
Ioana.
Similar Messages
-
How to add 2 days to a date field?
How to add 2 days to a date field if a Saturday was selected on a different date field?
ThanksI am attempting to add a date field and then have a another field add an amount to a box if the date is less than 30 days. Later I want to update the form to have the today's date is less than 10 days.
Early Registration Fee is $10.00 if posted by February 25, 2008
Late Registration Fee is $20.00 if posted by March 17, 2008
It seems simple, but, when you get to be 71 years old, it seems difficult. Any help will be appreciated.
Here is a link to the form I'm working on:
http://www.aworldwide.com/Gideon/Convention_Registration.pdf
I am using a trial version of Adobe Acrobat 8.
Thanks,
Andy Anderson -
Hi,
Suppose I am having date '28-feb-2007'. I want to add 1.9 years into this ? How can I do this ?
thanks & regards
pjpWhy not use Julian Dates?
Assuming 1.9 years is 693.5 days, round that to 693...
1 SELECT TO_CHAR(TO_DATE('20040229', 'YYYYMMDD'), 'J') "2/29/04",
2 TO_CHAR(TO_DATE('20040228', 'YYYYMMDD'), 'J') "2/28/04",
3 TO_CHAR(TO_DATE('20070228', 'YYYYMMDD'), 'J') "2/27/07",
4 TO_NUMBER(TO_CHAR(TO_DATE('20040229', 'YYYYMMDD'), 'J'))
5 - TO_NUMBER(TO_CHAR(TO_DATE('20040228', 'YYYYMMDD'), 'J')) "2/29 - 2/28",
6 TO_NUMBER(TO_CHAR(TO_DATE('20050228', 'YYYYMMDD'), 'J'))
7 - TO_NUMBER(TO_CHAR(TO_DATE('20040228', 'YYYYMMDD'), 'J')) "2/28/05 - 2/28/04",
8 TO_NUMBER(TO_CHAR(TRUNC(SYSDATE), 'J')) "Julian",
9 TO_NUMBER(TO_CHAR(TRUNC(SYSDATE), 'J')) + TO_DATE('365', 'J') "Today+1.0",
10 TO_NUMBER(TO_CHAR(TRUNC(SYSDATE), 'J')) + TO_DATE('693', 'J') "Today+1.9",
11 TO_NUMBER(TO_CHAR(TRUNC(SYSDATE), 'J')) + TO_DATE('730', 'J') "Today+2.0"
12* FROM DUAL
10:40:17 SFF@MIPSLPPE/10.2.0.3
SQL> /
2/29/04 2/28/04 2/27/07 2/29 - 2/28 2/28/05 - 2/28/04 Julian Today+1.0 Today+1.9 Today+2.0
2453065 2453064 2454160 1 366 2454165 04-MAR-08 26-JAN-09 04-MAR-09
1 row selected.Sam -
Hi,
I want to add number of days in a date string using jsp.
<%--
Document : try5
Created on : May 20, 2008, 6:00:20 PM
Author : thamaraiselvan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String datetxt="2008-05-20";
%>
</body>
</html>How to add 30,90,180,365 days in that String datetxt value.
Thanks Alot....Hi,
How to format a string value into a Date.
I typed the following code .but its gives a exception.
<%--
Document : try5
Created on : May 20, 2008, 6:00:20 PM
Author : thamaraiselvan
--%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="java.sql.*,java.util.Date,java.util.Calendar,java.text.SimpleDateFormat" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>JSP Page</title>
</head>
<body>
<%
try
String datetxt="2008-05-20";
int e=30;
// calendar.set(Calendar.DAY,calendar.get(Calendar.DAY)+30);
// Calendar cal = Calendar.getInstance();
//Date today = cal.getTime();
SimpleDateFormat fmt =new SimpleDateFormat("yyyy-MM-dd");
String thamu = fmt.format(datetxt);
out.println(thamu);
catch(Exception e)
out.println(e);
%>
</body>
</html>Exception Like This :
java.lang.IllegalArgumentException: Cannot format given Object as a Date .
After Formatting to date i want to add 180 days from '2008-05-20' .
Please Help me...
Thanks Alot.... -
Is it possible to add number of days to date?
I am working on a form where I need to add number of days to a date and come up with a date.
Header 1
Header 2
example date: March 1, 2013
+ 30
= march 31 2013
1. is this possible? Header1/cell 1 is a date field. Header 2/cell 1 is a dropdown field (30, 60, 90,120, custom),.
Header2 cell2 not sure what field to use date or text?
thank youNever mind I figured it out. Thanks
-
How to Calculate column (Month, Year) from date or timestamp
Hi,
Name
SQL Data Type
Dimension
Column Store Data Type
Key
Not Null
Default
Comment
T_STAMP
TIMESTAMP
LONGDATE
How to generate Month and Year from timestamp field in Analytic View.
Please provide me some valuable input. I have searched SCN before posting this discussion.Hi KD,
You can apply the following formulas in the expression:
For Year :
leftstr(string("Timestamp"),4)
For Month:
midstr(string("Timestamp"),6,2)
Regards,
Krishna Tangudu -
How to add new fields to a data extract
The following data extract program generates an output file which is displayed using a publisher template as a check format report.
Oracle Payments Funds Disbursement Payment Instruction Extract 1.0
How would I add new fields to the generated file? In other words what is the procedure to add new fields to the data extract?
ThanksDo anyone pls advise how to customize the payment extraction program? We also have the similar requirement to extract extra fields to format a payment file.
-
How to add number to excel sheet work book cell?
I am trying to create an excel sheet dynamically. I am able to create and populate the data as well.
But in one of the cell I have to add 1.0 value. Since I have added this as a new Label(...), after opening the excel sheet I can see an icon in the cell with message as "Number in this cell is formed as a text".
SO I have changed Label to Number while adding to cell.
I am using the format as "#.#". Othen than 1.0 everything I can see in the cell as x.y format. Like 1.2, 5.7 etc...
But for 1.0 I can see as "1." only.
Is there any way to write 1.0 to cell as a number.
I am using jxl.jar for excel.I have jxl supported api.
It supports formating the numbers.
It has NumberFormat class to support formating.
NumberFormat format = new Numberformat("#.#");
WritableCellFormat cellFormat = new WritableCellFormat(format);
excelSheet.addCell(new Number(1, 0, 1.0, cellFormat);
Api for Number : Number(int column, int row, double value, Cellformat ft);
If I add other than 1.0, data is displayed properly in the sheet.
1.2, 4.5, 3.567 --> 3.6 etc... -
How to add check boxes on plant data /storage tab of MM01/02/03 transaction
Hello experts,
I want to add check boxes on plant data /storage tab of MM01/02/03 transaction.
How can we achieve this?
Thanks for your help in advance!Hi Shriram Nimbolkar ,
Go to tranx code : MM01 /MM02 / MM03
1 ) System-->Status , here copy the program
2) Go to abap editor ,specify the program name and copy the package
3) Go to CMOD or SMOD
CMOD>Utilites-> SAP Enanchements, Here specify the package and execute it..
4) Displays multiple exists,
check the suitable exists and insert the code in particular screen...
Reg
Siva Prasad -
How to add one day to a Date?
Hi,
What is the simplest way to daa one day to a Date object?
Thanks.
PengyouYou use a database query just to add one day
to a Date object? I wouldn't call that the "simplest"
way at all.I was going to suggest firing off an email to the naval observatory and having them carry out the calculation, emailing the result back (maybe using JMS, not sure - web service possibly?) but the OP's way is simpler. -
How to add one second to a date time stamp
What is the proper syntax to add one second to a date/timestamp?
Just think about it.
24 hours in a day, 60 mins per hour and 60 second per minute
total of 86400 seconds per day.
So, you add 1/86400 to the date/timestamp column
e.g. select my_date + (1/86400) from my_table;
What is the proper syntax to add one second to a date/timestamp? -
How to add collection to report as data source
Hi all,
i'm trying to add collection to report as data source:
List<DmsLockingItem> items;
ReportClientDocument rcd = new ReportClientDocument();
DatabaseController dbc = rcd.getDatabaseController();
dbc.setDataSource(items, DmsLockingItem.class, "tName","tName");
this works with com.businessobjects.crystalreports.sdk but not with rasapp.jar.
And i can't use plugin lib in my current project.
can anyone help please?
Greetings,
NikolasThe setDatasource expects the object passed to either be a DataSet, java.sql.ResultSet, IXMLDataSet, or BusinessView object. Are you able to convert your collection to one of these?
-
How to add Time field in the Date Calender in OAF screen
Hi All,
is there a way to add time field in the date calender, so that the user can set the time and select the date, then return the date/time to the specified field?
or is there any slandered calender that has this functionality?
Regards,
Mahdi ChararaHi Mahdi ,
If you are working on standard page then you can create a new item by personalization and set the DataType as : DATETIME it will display
date as well as time .
For custom page - you can create a new item as desired in anywhere in page and set the DataType as : DATETIME it will show both time
and date .
Is this what you looking for ?
--Keerthi -
How to add a UDF with picture data type by using metadata object?
Hi guys,
does anybody have a clue on how to code user fields metadata object (via VB6) in order to add a picture type field? I can't find the enum number for this data type in the DI help file.
Best Regards,
OkiHi,
The field type should be BoFieldTypes.db_Alpha , and the subtype BoFldSubTypes.st_Image .
And it is in the DI documentation (look at the SubType property).
Regards,
Ibai Peñ -
Hello -
I've been tearing my hair out over this problem i'm trying to solve, probably just been staring at it too long which is making it worse -
I have a series of open support tickets which are supposed to be updated on a daily basis, the problem is that they aren't always being updated daily. So, the business wants to know the number of days from when a ticket was last updated and today's
date. I have this basic calculation and it's working fine, however now the business wants to exclude weekends from the calculation. The other problem is that some reps DO go in on weekends and update their tickets, so sometimes there will be updates
made on weekend dates.
To give an example -
Today's date is 2014-02-10 (Monday). A ticket was last updated last Thursday, 2014-01-30. The difference between the two dates is 11, so it's been 11 days since the ticket was last updated. Now, if I exclude Saturdays and Sundays, then
it's actually been 7 days since the ticket was last updated. I'm not sure how to do this in T-SQL.
Now, to further complicate the problem, sometimes a ticket IS updated on a Saturday or Sunday. So, if a ticket was updated on 2014-02-02 (Sunday), then it should be counted. Again i'm not sure how to do this.
What gets me is that this is probably fairly simple and i've just been staring at it too long. In the meantime, can someone offer some guidance?
Thanks!!I've adapted this from a function on my blog. you will need to add set the YourTicketTable to where ever your tickets are stored.
CREATE
FUNCTION [dbo].[CalcWorkDaysBetween](@StartDate
As DateTime,@EndDate
AS DateTime)
RETURNS
INT AS
BEGIN
SET @EndDate
=DATEADD(DAY,1,@EndDate)
DECLARE @Count
AS Int= 0
DECLARE @Date
As Date=@StartDate
WHILE @Date
< @EndDate
BEGIN
IF (DATEPART(WEEKDAY,@Date)IN(1,7)
OR (SELECT
Count(*)
FROM YourTicketTable WHERE TicketDate=@Date)=1)
BEGIN
SELECT @Count = @Count
+ 1
END
SELECT @Date=DATEADD(Day,
1,@Date)
END
RETURN
DATEDIFF(DAY,@StartDate,@EndDate)- @Count
END
Regards,
Maybe you are looking for
-
Crossdomain.xml Not Working
Ok, so first off, my environment. I'm working on a flash application that resides on the web server (192.168.1.74) and the data its pulling is from a device (192.168.1.77). On .77 I have a crossdomain.xml. I have attached the crossdomain.xml file. Th
-
Hi, we are using CRM 5.0 PCUI. The Activity Application works fine but the Tabpage Activities in Account Application (Event: ACC_ACTIVITIES, Toolbargroup: ACC_ACT01) not working correctly. If we try to Create an Activity with the "Add Entry" button n
-
Pocket Mac vs. Missing Sync
Does anyone know which is better between Pocket Mac and the Missing Sync? I need a program to sync my Dell Axim X3 with my PowerBook G4. Thanks for your help.
-
Often when I come to save a file, generally a JPG, it reaches the save box then the program locks up, the only way forward is to clost the program down using Task Manager and reopening photoshop - Any ideas ?
-
Transition Issue between tracks
Hello all, I'm sorry if this has been addressed elswhere, but I couldn't find this specific issue. I've noticed in my exported videos (.mts to H264 .mp4) that I experience some artifacting on the right side of the screen when transitions such as a cr