SQL data type time - sql

Is it possible to create a data type in SQL similar to time that only displays the hour and minutes instead of the hour, minutes and seconds.
For example, If I inserted values into a table with the data type time I would get hh:mm:ss. How could I insert a value that only displays hh:mm?

Use TIME. More generally, the format in which you want something displayed should not affect your decision of the format in which it should be stored.

Related

how to set time interval in pentaho?

I'm working on a project and I need to associate data, where the precision of times is given in seconds. But the times are not exact, I wanted to associate them with a time interval. How can I do this?
I tried the select values ​​to put this time interval, and I couldn't.
You can use the Formula step, create a new column with the following function: NOW()

Converting a column of date and time of day into running seconds

I am just wondering if there is a way that I can convert the contents of the column described in the picture I have attached to a total of running seconds where the first row is of course zero seconds so that the next row would be ~8220 seconds and so on. This would make the analysis of time-series data much easier for me.
Picture

Access date format

I'm having trouble copying a date field from one table to another in Access, the date format in my tables is showing as 23/08/2019 (23rd August). Usually I pull data into a VB.NET application, process it then insert it back into the DB, when I do this I use a function to convert the date into American format 08/23/2019 and it works fine, but I'm trying to copy the date into another table just using SQL and it puts it the wrong way around:
INSERT INTO Bets (rdate, track, horse, odds)
SELECT rdate, track, horse, odds
FROM Selections;
This is odd as even though it shows the UK format in original table, it still works correctly, I.E. records with date 02/01/2019 would appear when selecting records for January 2019, but copying it to another table in this format makes it backwards.
There is nothing to "convert".
You are mixing up the date value and the display format. The value is what matters, the format is for display only.
If you don't apply a specific format when listing the values, a default format is applied.

In Mongo DB , How to get the inital date of data insertion

I entered many data in MongoDB on different dates,
for example
from January, each day I entered data, how to know which date I started data insertion process
I think that there is no way to find that out, a workaround for that is you can alter your table and add a timestamp column, with default value now().
That let you see when future inserts are created.

sql passing a date to a datetime

I have a few user controls I made in wpf that are driven by two datepickers. One picker controls the begin of the date range and the other one controls the end of the date range.
I had issues with the datepicker.selecteddate property giving me the time along with the date and then my sql results were not all there because the passed in time value filtered out a lot of my results. I ended up finding that if I formatted that time to midnight then my results were all there, but every time I picked a new selection in the datepicker it would reset the formatted time.
After some testing I found that I can just pass the value of the datepicker text property as the parameter. This property's value is a string type and is set to the date value of the current selected date (ex: 3/14/2012 5:00:32 AM is selected date then '3/14/2012' is the text value).
So far, surprisingly, this seems to return all my results I wanted.
I was wondering about why this actually works (is it b/c the 'mdy' literal format is supported and the default?), and if there is any negative drawbacks to doing what i'm doing? I know a lot of times just because something works doesn't mean you should use it in production. I share the tables with others or I would just convert the datetime fields and parameters to date and be done.
I hope my question makes sense. Sometimes they don't. If there are questions leave comments and i'll chime in.
As far as negative drawbacks, I cannot see any - this is how we handle it throughout many apps/DBs. However, the way I typically handle it is if the record being added doesn't need the time (i.e. BusinessDate, LoadDate) then I add the record with the only the Date and no time - so the value is always in the format 3/14/2012 12:00:00 AM which I think makes querying significantly easier since you don't have to deal with the time
Then in my UI (winforms) when performing a search on the date with a datetimepicker I use the datetimepicker.Value.Date which gives the date in a similar format (3/14/2012 12:00:00 AM).
If you have a field in a table that needs a datetime, then use it and you can search the date by either formatting the date in the table or using date > yourdate AND date <= yourdate which would include the date you are searching.