How to select a date from calendar in selenium webdriver - selenium

I am trying to automate price line website and trying to select the date range. But unable to do it.

There are two way i can think of to select date from calendar.
First way and easy way:
If date field is a textbox or if you can set the date using selenium sendKeys , you can go for sendkeys itself to select the date. Just make sure the format of input.
Second way:
You have the build the logic to select the date, i can suggest one way to select date here,
First format the input date(your input) as day , month and year.
Select the year first(it's depends on the application like selecting from dropdown or click left and right arrow , etc...).
Go for the month next and then day.
you can still put some condition while selecting the date for example, checking date is not disable before selecting it.

Related

How to get records month wise on rollover calender

I am using following query to get records count on month wise and it is working fine:
SELECT MONTH(dte_cycle_count) MONTH, COUNT(*) COUNT
FROM inventory
WHERE YEAR(dte_cycle_count)='2021' --OR (MONTH(dte_cycle_count) = '1' OR MONTH(dte_cycle_count) = '12')
GROUP BY MONTH(dte_cycle_count);
Problem:
Now I need to bind rollover calendar so user can scroll or click on next or previous button the next 12 Months record will be visible.
eg. Current month is MARCH, So default records will be from APR2020 to MARCH2021. If user click on previous then records will come MAR2020 to FEB2021.
How I can achieve this?
Please let me know if need more information. I will try my best to provide.
I think what you are after is a date list from which to join to your inventory table.
Like a numbers table, build a static table with columns for date, year, month, populated from whenever you need to far in the future.
You then select from this, applying your filtering range critera, and join to your inventory table.
For an efficient query, ideally your inventory table should have the relevant date portions eg year and month stored to match.
You don't want to be using functions on a datetime to extract the year or month as this is not sargable and will not allow any index to be used for a seek lookup.

I need to convert total date to month only

I set up a google forms form for my work where my employees pass information and this information is recorded in a spreadsheet. The information, when recorded, automatically inserts a date and time in the first column of form responses. However, when I enter the code = month (a1), it always returns the answer "1" or "January" and this information does not match the date entered in the column. How do I fix this?
If you are entering '=month(a1)' for every row, then you are always taking the month of the top left cell in the sheet. You would need to adjust the row number for the row you are in.
You could use something like '=month(now())' to ensure you are always getting the month of the current date.

MS Access - Extracting Min/Max Year from a Union Query onto a Report

I have a union query that pulls objects and their dates from a query and table with similar fields so that I can display them together on a report. The union query (qry_ObjectUnion) has a WHERE function that prompts the user to enter a start and end date.
SELECT [Object], [DateObject]
FROM qry_ObjectQuery
WHERE (((Year([DateObject])) Between [Which year would you like this report to start?] And [Which year would you like this report to end?]))
UNION SELECT [Object], [DateObject]
FROM tbl_ObjectTable
WHERE (((Year([DateObject])) Between [Which year would you like this report to start?] And [Which year would you like this report to end?]));
On the report, I’d like to dynamically display the start and end year the user chose for the report. To accomplish this, I wrote a second query (qry_ObjectUnionYears) off of the union query.
SELECT Min(Year([DateObject])) AS MinYear, Max(Year([DateObject])) AS MaxYear
FROM qry_ObjectUnion;
The second query returns the start and end year as expected when accessing (double-clicking) the query directly, but opening the report yields different results. In the report, I have a textbox with a MinYear control source of:
=[qry_ObjectUnionYears]![MinYear]
When accessing the report, the first two message boxes ask for the start and end year, but the third message box asks for a parameter value for qry_ObjectUnionYears and proceeds to return a #Error no matter what I enter.
Can anyone help me out? Thanks in advance!
I figured it out after browsing online some more. The textbox can self-reference the parameters entered into the report as so:
=Report![ObjectReport]![Which year would you like this report to start?]
There is no need to write a second query as I originally tried to do.

Qlikview how to get all excluded values on qlikview

I have two columns on Qlikview table: date and full name.
All people work on some dates.
If I choose a date, it shows me a list of people who work on that date.
I need to make a table of all the people that do not work on that date.
I have tried to make a page trigger to select unchecked but it doesn't help me.
Select the date you want -> Right click on the date's list box and do 'select excluded'
Try to use element function E() which represent the excluded set.
sum({$<Dim1 = E({$})>} Expression1)
In your case Dim1 would be the Date dimension.
//Micke
Click on the date you want.
Right click on it.
Select Excluded.

How to select dates with same day and month (ignoring year) using firebird

I have a database where users stores their birthday. y-m-d, and I'm trying to get every user that has the same birthday; the year can be different between each user.
So how do I turn this to a working script:
SELECT username FROM table_name WHERE birthday='$birthday'
$birthday gets its data from a form, where the inputs is example: 2002-02-02. And if users have this birthday it should echo it out. But the problem is that it checks with the year, and I'm trying to only get month and day, not year.
I have tried with EXTRACT(MONTH FROM ...) but didn't get it to work. What am I missing?
You should store your data as DATE. Then the date/time like EXTRACT functions will work.
I recommend adding new column and filling it with data from the original one using CAST. Then dropping the original column. Also consider using parameters instead of string concatenation to prevent SQL injection.
select
extract(MONTH from cast('2002-02-02' as date))
from rdb$database