0

Good afternoon,

I would be very grateful is someone would be able to offer some assistance to a query I have regarding some SQL I'm needing to implement.

In our database we have a range of customers that have specific properties/category tick boxes associated with them. We're wanting to display a list of all customers that have a certain tick box selected/ticked since a set date. This date is 05-07-17. Would this be possible? Kind of lost as how to display this. Se screenshot below..

properties list associated with customer account

Kind regards, Chris

1
  • 1
    You'll need to provide more information. For starters, do you record the date when the box is checked in your system? What tables are involved? How are they connected?
    – RDFozz
    Sep 1, 2017 at 16:17

1 Answer 1

1

Select customer_field_names from database WHERE date_column >= '2017-05-07' AND tick_mark_field is NOT null;

That should show all listed fields where the date is at least 05/07/2017 and the check mark box is filled in, in some way. This assumes that they are in the same table.

3
  • Hi mate, cheers for the suggestion but I have just noticed this query and perhaps the one I was trying is returning results of any updates made to the customer account and not updates to this particular tick box (I hope this makes sense?).
    – Chris
    Sep 1, 2017 at 13:12
  • Then likely you do not have null, but some other character in the tick box. You will have to check it for value then. Chang tick_mark_field = character.
    – DCook
    Sep 1, 2017 at 13:24
  • Hey, yes this is the case. Blank = 'N' and tick = 'Y'. When searching on the date I am using T0.[UpdateDate] which is the 'date of update' - it just seems when im inputting the date im interested since (5th July), it is returning any old updates made to the customer account and not specific to the tick property.
    – Chris
    Sep 1, 2017 at 13:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.