MDB query for Time - ms-jet-ace

I have table as
Id Name Date Time
1 S 1-Dec-2009 9:00
2 N 1-Dec-2009 10:00
1 S 1-Dec-2009 10:30
1 S 1-Dec-2009 11:00
2 N 1-Dec-2009 11:10
Need query to display as
Id Name Date Time
1 S 1-Dec-2009 9:00
1 S 1-Dec-2009 11:00
2 N 1-Dec-2009 10:00
2 N 1-Dec-2009 11:10
My backend database is MS Access and using VB6 for Max and Min time

I would make an additional two [int] columns, say hour and minute and then use an MS Access query to sort them. It would be MUCH easier to call that in VB. The query itself would be something like the following:
SELECT * FROM YOURTABLE ORDER BY id, hour, minute;

Related

How to define a Cron Expressions of Quartz 2

I read corn expression tutorial this and managed to make simple expressions like : 15 14 5 12 0 represents as
15(minutes)14(hours) 5(day-of-month) 12(month) 2(day-of-week) that means
At 14:15 on day-of-month 5 and on Sunday in December.
I didn't understand how do I define the repeated expression. I can write corn expression.
Every day at 01:00 a.m. Should be 0 1 * * *.
how to write an expression every last day of the month(end of the month) at 01:00 am?
I found a way to do it.
Daily at 1:00 A.M corn expression should be: 0 0 1 * * ?
The last day of any month at 1:00 A.M corn expression should be: 0 0 1 L * ?
I verified the expression by this http://www.cronmaker.com/. I have to apply it in my code now.

Generate a interval based time series using Spark SQL

I am new to Spark sql. I want to generate the following series of start time and end time which have an interval of 5 seconds for current date. So in lets say I am running my job on 1st Jan 2018 I want a series of start time and end time which have a difference of 5 seconds. So there will be 17280 records for 1 day
START TIME | END TIME
-----------------------------------------
01-01-2018 00:00:00 | 01-01-2018 00:00:04
01-01-2018 00:00:05 | 01-01-2018 00:00:09
01-01-2018 00:00:10 | 01-01-2018 00:00:14
.
.
01-01-2018 23:59:55 | 01-01-2018 23:59:59
01-02-2018 00:00:00 | 01-01-2018 00:00:05
I know I can generate this data-frame using a scala for loop. My constraint is that I can use only queries to do this.
Is there any way I can create this data structure using select * constructs?

Cron Expression for every second Monday of the month (for Hangfire)

I am trying to create recurring job in hangfire that runs, once a month at the second Monday, something like this:
1. Monday, May 14, 2018 8:00 AM
2. Monday, June 11, 2018 8:0 AM
3. Monday, July 9, 2018 8:00 AM
4. Monday, August 13, 2018 8:00 AM
5. Monday, September 10, 2018 8:00 AM
I have found this answer in stackoverflow, but since this is not a standard cron for scheduling hangifre jobs I can not use it.
My question is can I make an expression like this using the format
* * * * * (min hour day/month month day/week)
The following command seems to work for me.
0 8 ? * MON#2
Assuming that you want this job to execute at 8 AM the second Monday of each month, the # character allows you to specify the "nth" day of any given month. We use the ? character in the day/month row since we are fine with any numeric day as long as it is the second Monday.
Read more about special characters here: http://www.quartz-scheduler.org/documentation/quartz-2.2.2/tutorials/crontrigger.html#special-characters
Below are cron for three different time for every 2nd Monday, Look into the pattern and make change in time as per your need day
For each second Monday of the month at 00:00 hrs, try below:
0 0 0 ? 1/1 MON#2 *
For each second Monday of the month at 10:30 hrs, try below:
0 30 10 ? 1/1 MON#2 *
For each second Monday of the month at 13:30 hrs, try below:
0 30 13 ? 1/1 MON#2 *
Here you go.
0 0 12 ? 1/1 MON#2 *
minute hour day month dayofweek command
0 0 8-14 * 2 /path/here
This will run a job every second tuesday of the month at midnight.
8-14 limits the occurance of tuesday to the second week in the month.
1-7 first week
8-14 second week
15-21 third week
22-28 forth week
29-31 fifth week

Primefaces Datatable rowindex after using summaryrow

I am using primefaces datatable with a rowIndexVar="rowIndex" property for a Sl. No. column used as so : value="#{rowIndex+1}"
I am also using summaryRow where I calculate total hours , sorted by date and employee. I wanted to know if I could start with a fresh rowIndex from 1 after each summaryRow. Right now it goes from 1 till the size of the list,but I want it like ->
1 10/03/2015 7:00 am 8:00 am 1 hr
2 10/03/2015 8:30 am 10:00 am 1.5 hr
-------------------------------------------------------
<summaryRow> Total hours worked for 10/03/2015 : 2.5 hr
-------------------------------------------------------
1 11/03/2015 7:00 am 9:00 am 2 hr
2 11/03/2015 9:05 11:05 am 2 hr
-----------------------------------------------------
<summaryRow> Total hours worked for 11/03/2015 :4 hr
------------------------------------------------------
Instead of it being continuously
1
2
3
4 ..etc
No, sorry. This is not possible. Closest you can come is use your own numbers dynamically in model

Quartz Cron expression :Run every 15 days ie twice in a month

I want to set the scheduler with a quartz cron expression which will trigger every 15 days ,for example 1st and 15th of every month.The 0 15 10 15 * ? is triggering only on 15th of every
month.
I have tested this and the following expression works fine
"0 0 0 1,15 * ?"
the 1,15 statement fires triggers on 1st and 15th of every month at 00:00 hours.
You can change the first three zeroes to fire them at a particular time you want.
the 1st zero -> seconds
the 2nd zero -> minutes
the 3rd zero -> hours
0 0 1,15 * *
“At 00:00 on day-of-month 1 and 15.”
0 0 1,15 1 *
“At 00:00 on day-of-month 1 and 15 in January.”
0 0 1,15 1 6
“At 00:00 on day-of-month 1 and 15 and on Saturday in January.”
The following also works fine, it executes your command on the 15th and the 30th at 02:00 AM of every month:
0 2 */15 * * <yourCommand>
You just need to append 1 with a comma to your expression at 'Day of Month' block.
Rest is fine !
0 15 10 1,15 * ?
This will schedule to run every 1st and 15th day of the month and 10:15 am.

Resources