milo
November 26, 2019, 3:23pm
1
Is there a way to do a like statement with query builder? I am trying to achieve
WHERE data.arrival LIKE ‘%2019-11-29%’ AND data.arcitycode = ‘bwi’.
The date and city code being url variables. The date I am searching is a datetime field, but I just need the date not the time.
thanks
milo
November 26, 2019, 3:41pm
3
What do the emojis represent?
Teodor
November 26, 2019, 3:42pm
4
Not sure what you mean, but click on the link i posted and check the discussion please.
milo
November 26, 2019, 3:46pm
5
contains does not exist in the query builder.
Teodor
November 26, 2019, 3:47pm
6
Contains is available for strings only.
milo
November 26, 2019, 3:50pm
7
So there is no way to do a contains with a date? sorry a little lost. I can put the LIKE in a custom query, but not sure how to get the url variable in the statement with the % :P1 % for example
Teodor
November 26, 2019, 3:51pm
8
Well, no that’s not possible - but i am not sure i understand what are you trying to achieve?
milo
November 26, 2019, 3:53pm
9
I simply want to query a date, but just the date part of the datetime field.
Teodor
November 26, 2019, 3:55pm
10
How do you filter it - where does the filter value(s) come from?
milo
November 26, 2019, 3:56pm
11
URL variable. example ?arrivaldate=‘2019-11-29’.
Teodor
November 26, 2019, 3:59pm
12
Do you store hours or it is just the default 00:00:00 as you are using DATETIME database fields?
milo
November 26, 2019, 4:00pm
13
there are hours and minutes in the date time field. This is a list of flights. all have arrival times, but I want to just get everything for the day. Ignoring the time.
Teodor
November 26, 2019, 4:16pm
14
Then you can use the between condition and then format the date, in the format you need using the data formatter:
{{$GET_variable.formatDate("yyyy-MM-dd 00:00:00")}}
and
{{$GET_variable.formatDate("yyyy-MM-dd 23:59:59")}}