DSE Solr date range query for String date 'yyyymmdd' & integer hour - string

I'm using Datastax Solr version 4.8. I've column with string values of date in 'yyyymmdd' format and another column with int values of hour. Now the requirement is to fetch all the records say from yyyymmdd - '20161110' to '20161130' and from hour 21 to 15.
Is there any way to get this search using DSE Solr?

I would suggest you to use a copy copy field with that string date as the source and a date field as the destination. Once your string date has been converted into an actual proper date you can query it like a normal date 'AND' the hour into the query. Hope it helps.

Finally I ended up adding timestamp column to get the date range query result.

Related

How to read string column in format ‘15Aug21:12:45:24’ as time stamp in Tera data?

I have a character column in teradata table with format like this - ‘15AUG21:06:38:03’. I need to convert this column into time stamp so that I can use this column in order by statement. I am using teradata sql assistant to read data.
Use TO_TIMESTAMP:
SELECT TO_TIMESTAMP ('15AUG21:06:38:03', 'DDMONYY:HH24:MI:SS');

HANA SQL:Import Excel Field formatted as date into Dataset or convert excel date values (eg. 43830 for 31.12.2019) to Date

I'd like to upload from an Excel file with a column formatted as date in excel to a dataset in the Analytical workspace of Tagetik on HANA database.
As excel stores date values as numbers (eg43830 foe 31.12.2019) I get an orror uploading in a dataset field with type date as 43830 is not a valid date format.
Uploading the excel field in a Dataset field with type text or number works, but then I have the numeric representation there.
So I'd like to convert this number (43830) to a valid date (31.12.2019) - I did not find an appropirate function in HANA SQL.
Thanks for some ideas.
best
Sabom
Why do you dont convert the number to a date as string in excel before upload and just use that date? Sounds like the easiest. Nontheless, you could use ADD_DAYS in HANA. The number you are seeing are days since January, 1st 1900. So ADD_DAYS with a base of 1900-01-01 should work.

what is query to change the data type of Date from string date time format in elastic search?

I am working on an elastic search. I need to change the data type from string to date format.
The field name and its value is the date and 2020-02-01 08:17:22.438000. Now it is I string data type. I need to change into the date-time format in the elastic search itself.

Change date format from database

I'm using Stimulsoft Reports.Ultimate 2016.1. My date format from the database is dd-mm-yyyy. Is there any way that I can change the format into dd/mm/yyyy and display it like that?
You can achieve it by following query. Replace dbDate and table_name with yours.
If dbDate is in varchar format you need to convert it first to datetime and then you can apply the below query.
select convert(NVARCHAR,convert(datetime,<dbDate>),101) from <table_name>
If dbDate is already in datetime format then you can simply apply below query to format date into dd/mm/yyyy
select convert(NVARCHAR,<dbDate>,101) from <table_name>
If you have any suggestions or doubt let me know.

How do I query for a specific day such as yesterday in Core Data?

In plain SQL (in my case: sqlite), I would be able to query for a specific date in a DATE column as follows:
SELECT * FROM table WHERE date(dateColumn) = '2015-01-01'
This works because the date() function cuts off the time part of the DATE value.
Can I do something similar with Predicates in Core Data? Or do I have to use something where I determine the start and end of that day and then look for dates between the two date values?

Resources