Linked Date Pickers - twitter-bootstrap-3

I am using the linked date time picker given at http://eonasdan.github.io/bootstrap-datetimepicker/
My problem is with picking up the date and time for an intra day event.
For example in the first text area select this date and time :02/26/2015 8:48 AM
Now attempt to select this date and time in the second text area:02/26/2015 9:20 AM which does not happen.
The problem can be simulated on the above link.

Related

Set calendar dates

I am using DatePicker and I want to set a calendar date based on other calendar field, if the date of first calendar falls in current month then the date of second calendar should be valid from the date of first calendar (for eg: 1st calendar date is set to 20-06-2021 which is of current month then the second calendar date should allow to add date from 20-06-2021), if the date of first calendar falls in last month then the date of second calendar should be valid from the start date of this month (for eg: 1st calendar is set to 20-05-2021 which is of last month then the second calendar date should allow to add date from 01-06-2021), please give me a solution on how I can resolve this issue.
You can do it by using state suppose you have started your first date picker from 2021-06-20
this.state = {date:"2021-06-20"}
and then when the user changes the date you update your state by
onDateChange={(date) => {this.setState({date: date})}}
now by using this updated state you can start your second date picker by using the current state.
And by assigning it to a variable you can apply any conditional statements that you want.

Hive - How to query a unix timestamp to identify yesterday's values?

I have the following problem to solve. I have a hive table, that store events, and each event timestamp is stored as unix timestamp (e.g. 1484336244).
Every day I want to run a query that fetches yesterdays events.
How could I form this query in Hive?
So for example, today is the 9th February, I want to get only the events that occurred on the 8th February.
Subtract one day from current_date and compare it with the column converted to yyyy-MM-dd format.
date_add(current_date,-1) = from_unixtime(colName,'yyyy-MM-dd')

Starttime and endtime

i have paramters fields as starttime(=DateAdd("d",-1,now())) and endtime (now()) and status( as dropdown ex:running,succededtec,.) in my report.... when i run the report with the whole timestamp it is working as expected but if i give only date in both the fields without time then am not getting last one days data( for example if starttime is 6/14/2017 and endtime is 6/18/2017 am getting data till 6/17/2017 only) .....one more scenario is when I have no endtime (like status is running we have no endtime) then am getting that.Can anyone help me out.
Thanks
The time defaults to 00:00:00 if not included.
So basically when you're comparing say
06-18-2017 07:52:11 <= 6-18-2017
you're actually comparing
06-18-2017 07:52:11 <= 6-18-2017 00:00:00
Since the time defaults to zero, and you will never get any 6-18 results returned unless they happened at exactly midnight. Set the timestamp in your compare, or use 6-19 as your compare date instead (with the risk of including a random record that happened at exactly midnight on 6-19).

SQL Query to pick data from a certain time range

I have two fields in my DB.
1) Invoice_Date and Invoice_Time
They recored date and time from my invoices.
I want to pick data under two queries:
1)Using From_Time DateTimePicker and To_Time DateTimePicker (they display as 19:20:18 PM)
Here I want to pick data for say between 13:10:12 PM to 18:10:20 PM, no matter what date it is.
2) Secondly I want data for a specific data range (from datatimepickers) to specific time range (time datatimepickers)
Please advise how to do it.
I tried:
Where InvTime between #Time1 and #Time2
But it did not generate any data, while data is there for the given time range.
Please help.
Thanks
I think if I understand you correctly you want you want to find all invoices between a start and stop time based on your invoice time. I will assume the invoice time is a date time field that may have different date values.
Where CONVERT(DATETIME(CONVERT(CHAR(5),invoice_time)) BETWEEN #StartTime AND #StopTime
You could also do the same conversion to your start and stop time. The key here is that all the datetime values you are comparing have the same date Since all we care about is time the date will just be the default.

Format date in Values for a Range (Gant) Chart SSRS 2008 R2

I have a date column in which the dates are re-curring every year. I'm only interested in the month really, but I can't just put the month number as the high and low value for the gant chart. Is there any way I can format the column? Any suggestions would be awesome.
The gant chart currently is taking the whole date and is working fine, but like I said it goes out to the next year.
Figured it out. So the DATECOLUMN I had was formated as such:
Example: 2013-01-01 00:00:0.000
In order to put in the GANT(RANGE) CHART in the series property, under values, I formated the Top Value and Low Value as =MONTH(DATECOLUMN) using the expression option.
Then for the Horizontal Axis Properties I set the Interval to 1 and Interval Type to Number. And There you have it Monthly time spans with only the Months 1 - 12 showing.
I must also note that I only had one time recorded. So I just did Top Value as: DATEADD(MM,1,DATECOLUMN) In Order to get the right time span in my dataset Script.
Which date format would u like to display in your chart.
If (month with year) like 'Sep 2013'
use this date format for the same.
SUBSTRING(CONVERT(VARCHAR(11),getutcdate(), 113),4,8)