Is there a trick to doing a search on a Date attribute, on a query, that is a shortcut to another BO?
Here is what I have...
Names BO that has a DOB shortcut that is coming from a Client File.
The attributes are:
AlsoKnownAs, Text
IsAka, Yes/No
parent_Client ---> ClientMaster
ClientDOB, shortcut to ClientMaster.DateOfBirth
ClientPhone shortcut to ClientMaster.PhoneNumber
ClientGender shortcut to ClientMaster.Gender
This is basically setup so that a Client can have any number of names that they might use.
Among numerous other fields the Client BO has ClientID, PrimaryName, DateOfBirth, child_Names (Multiple allowed), etc...
If I have a query for the Client BO, I can do a search on the DOB and it works just fine.
But, when I have the DOB shortcut on a Query for my Name BO, when I do a search on it I get nothing.
I can do searches on the Gender and Phone shortcuts just fine, it is just the date one that does not seem to work.
Is there something I am missing?
Query Filter on Date shortcut attribute returns nothing
-
- Posts: 297
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Query Filter on Date shortcut attribute returns nothing
Off the top of my head, my guess is that the shortcut is converting the date to plain text, so you will have to convert it back to a date.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: Query Filter on Date shortcut attribute returns nothing
Searching on date fields (EDIT: "BY ENTERING A VALUE IN A FILTER BOX") is a pain in the ass.
I have recently thought about converting a date field to a text field just for searching.
I would check to see if your underlying data type is a date, or timestamp. I am pretty sure that if it is a timestamp, but you are only displaying the data portion in the grid, you’ll never get it to work.
EDITED: See caps in line 1
I have recently thought about converting a date field to a text field just for searching.
I would check to see if your underlying data type is a date, or timestamp. I am pretty sure that if it is a timestamp, but you are only displaying the data portion in the grid, you’ll never get it to work.
EDITED: See caps in line 1
Last edited by Jaymer on Wed Oct 31, 2018 1:58 am, edited 1 time in total.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 297
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Query Filter on Date shortcut attribute returns nothing
Jaymer, it is actually a Date Type. I checked and rechecked for that.
What I ended up doing was just putting a Date attribute in my Names BO and have a rule set that it just updates it with the DOB attribute from the Client BO.
Now the date search works. But I would rather not do it that way.
I tried different ways to convert the shortcut to a string or a date field, as JonP suggested, but neither one would work.
What I ended up doing was just putting a Date attribute in my Names BO and have a rule set that it just updates it with the DOB attribute from the Client BO.
Now the date search works. But I would rather not do it that way.
I tried different ways to convert the shortcut to a string or a date field, as JonP suggested, but neither one would work.
-
- Posts: 1457
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: Query Filter on Date shortcut attribute returns nothing
Coming to this late and I may have misunderstood the issue.
Are you trying to put the short cut to the DoB on a grid or are you just searching for it?
If it is the placement of it on a grid I have no answer but if you are using the DoB as a search criterion could you not just look for
WHERE Names.ClientMaster.DateOfBirth = [some comparison]
Date fields are problematic if the field is empty also (if you haven't already encountered this)
Are you trying to put the short cut to the DoB on a grid or are you just searching for it?
If it is the placement of it on a grid I have no answer but if you are using the DoB as a search criterion could you not just look for
WHERE Names.ClientMaster.DateOfBirth = [some comparison]
Date fields are problematic if the field is empty also (if you haven't already encountered this)
-
- Posts: 297
- Joined: Wed Apr 22, 2015 11:44 pm
Re: Query Filter on Date shortcut attribute returns nothing
PointsWell, it is being placed on a grid. We are then trying to just look for a specific date with the filter options.