How to select specific date from date picker in UFT 12.05? - date

I want to select the Date from date picker where data is passing from outside uft i.e xls files,here i'm facing the problem i.e unable to select particular date i.e for example:
25-Aug-1960,in this one i'm able to select Aug and 1960 but unable to select 25 from date picker,please help how to resolve this issue.
Wait(4)
Browser("Customer Managemen").Page("Manage Customer_2").WebEdit("birthDate").Click
Browser("Customer Managemen").Page("Manage Customer_2").WebList("Year").Select "1950"
wait(2)
Browser("Customer Managemen").Page("Manage Customer_2").WebList("Month").Select "Aug"
Browser("Customer Managemen").Page("Manage Customer_2").Link("Dno").Click
Here Dno means -2 in date picker.

take a look at this answer here: Automating Date Control using QTP
Also, use the below code as reference to change it
Browser("Browser").Page("Page").Frame("DatePicker").highlight
Browser("Browser").Page("Page").Frame("DatePicker").WebList("Month").Select "Jan"
Browser("Browser").Page("Page").Frame("DatePicker").WebList("Year").Select "2015"
Set A = Browser("Browser").Page("Page").Frame("DatePicker").Link("1")
A.SetTOProperty "text",11
A.Click

Related

create a dynamic title that displays date range as per the start and enddate parameters used

I have a report that displays monthly and ytd amounts. I use start and enddate parameters that change according to the user. For example for startdate 4/1/2007 and enddate 2/28/2008
1. I need to display title as Monthly budget 2/1/2008 to 2/28/2008
2. I need to display title for YTD as YTD 4/1/2007 to 2/28/2008
I tried = Parameter!EndDate.value but it throws error
It looks like you may have missed a letter in your expression. It should be:
=Parameters!EndDate.Value
In the expression editor you can double click on the parameter name and it will insert it into the expression for you.
To get the full description that you mentioned, you'll need to use a combination of functions. One useful one to look at is DateAdd to add days and months to the specified date. Another one is FormatDateTime which allows you to use the standard "ShortDate" format.
If you run into further trouble, I would recommend posting a new question with the variations of code that you tried along with the specific error messages that you received.
You could try setting the Expression for a text box to:
="Monthly Budget " & FORMAT(Paramters!StartDate.Value, "MM/dd/yyyy") & " to " & "FORMAT(Paramters!EndDate.Value, "MM/dd/yyyy")
This will give you:
Monthly Budget 02/01/2008 to 02/28/2008
It is the same for your second requirement, just change the wording.

The difference in strings in Tableau

I am using Tableau Server version 10.4.3
I have a dimension rTime which has string value. the entries in rTime is of like this
May 10, 2019 8:59:56.303 PM UTC
I want to check whether the rTime is today or not. I cannot use DateParse since my server doesn't have this functionality.
I created a calculated field CheckrTime with below content :
STR(LEFT(SPLIT([rTime],':',1),LEN(SPLIT([rTime],':',1))-2))
When I am dragging CheckrTime into workspace area, the output is coming in below format which is what I wanted :
May 10, 2019
When I am checking ISDATE("May 10, 2019") (a normal string), it is outputting TRUE as expected but when I am checking ISDATE(CheckrTime) it is outputting FALSE . Why?
The reason I am checking above thing is I am looking to use DATEDIFF function of tableau in this way:
DATEDIFF('day', DATE(CheckrTime), TODAY()) == 0
NOTE
If someone is wondering ,I have taken care of the level of granularity.
If you have a better solution then the one I am following, please do tell me.
This is working for me. I would expect May 10 <> May 16 (today) and therefore return false. However, when I change your example to today's date it does in fact come back as true.
You could also try this formula for the date LEFT([rTime],FINDNTH([rTime],' ',3)). It is slightly less complicated but will give you the same answer.
Calculated field (date type) depends the locale used which defines date format. Are you able to use Date function?
In Tableau website there is a example using english locale
For string 06May2017
DATE (LEFT([Original Date], 2) + "/" + MID([Original Date],3,3) + "/" + RIGHT([Original Date],4))
Above mentioned highligts / character between digits which is depending on locale

how to get minutes from 2019-03-10 09:39:57 +0900 date in jasper report?

I want to get only minutes from 2019-05-07 13:05:08 +0900
I added this field as a java.sql.Timestamp
I have tried with--
java.util.Date
java.sql.Date
You can use the pattern option in date fields. The syntax works like java, by setting the format to "dd.mm.yyyy" and so on.
EDIT: There is an example here how to change the pattern to dd/mm/yyyy:
For this porpouse, use the pattern field of your textfield. Set the class of the field to java.util.Date and insert in the pattern field the string mm/dd/yyyy (or dd/mm/yyyy)
You can edit your pattern accordingly for just getting minutes.
As I do not have iReport installed currently I can only offer a solution on sql level: You also could format the selected field in your sql code:
select
sys_extract_utc(current_timestamp) as sql_timestamp,
to_char(sys_extract_utc(current_timestamp), 'MI') as timestamp_minutes,
to_char(sys_extract_utc(current_timestamp), 'DD-MON-YYYY HH24:MI:SS') as datetime_character
from dual;
This results in
SQL_TIMESTAMP | TIMESTAMP_MINUTES | DATETIME_CHARACTER
17.05.19 10:56:42,567411000 | 56 | 17-MAI-2019 10:56:42
But please be adviced that the last suggestion results in selecting characters rather than timestamps.
If you have more questions, feel free to ask.

Sending parameters to report from Java code

I need to send a timestamp value as parameter from java to JR report. I tried the following code but I'm getting a blank report.
My JRXML File:
`
`
The report works fine with normal date parameter but fails to display with Time-stamp value.
My Java code :
`
I tried various values of timestamp Ex: (new java.sql.Timestamp(2013-02-27) but it is not working.
Use:
new SimpleDateFormat("yyyy-MM-dd").parse("2012-01-01");
Simply putting:
new Date(2012-01-01);
would give definitely wrong date, probably EPOCH start date.
Ensure it's MM not mm when parsing your date for month. See SimpleDateFormat javadoc
EDIT
See the image. The date your default values will generate is around 1970.
Hence your Between Condition will get all the values between 1970 to Today.
EDIT : 2
In my opinion You are setting wrong parameter in Table's datasource.
Instead of setting From_Date & To_Date from Fields set them as parameter from the main report itself.
Refer Image.

Getting individual values from GWT datebox?

I'm a newbie so please help me in this. I have a datebox with a default date format and its working and displaying selected date in the box as expected.
Now, I need to get individual values from whats being displayed/selected, i.e., month, date, year. I need them to be used to query something in database.
Example : Displayed as July 14th, 2010. I require after displaying it in box, the numeric values as 7(for month), 14(for date), 2010(for the year).
Plese help, I'll be really thankful.
_ Chirayu Diwan
DateBox has a method getValue() which returns an obect of type java.util.Date. This class has individual method to get getYear(), getMonth() (offsets with 0, so 0 is January) and getDay().