Hi, I am currently using the following table structure: id, customerid, date_time_stamp, logged_in The following query goes here: select customerid from table where customerid='100' and date_time_stamp='sometime' So if have to check for 3 dates (9may, 10may, 11may), I need to run 3 different queries I was hoping if someone could suggest some other queries so I can check if this customer was llogged in in 3 different dates with 1 query, or something similar. I can change the table structure as well if needed. Any suggestion is useful cause I think I'm using the worst method right now... Thanks
my suggestion to you is select date_time_stamp from table where customerid='100' it will return all the dates for the mentioned customer id hope it will do the trick for you.
Yes, that will get me all dates, but that will be a lot of memory usage because some members are logged in everyday (and as the site gets older, this will slow the server a lot), and I just need to check if this particular member was logged in in a certain date range. Ex: 9may to 11may (3 days) I was thinking about a query like: "select date from table where customerid='100' and (date='9' or date='10' or date='11' ) "; but for some reason I think that is not as accurate as the method I am currently using. Anything else I can do? Thanks
then i suggest you to use a combo boxes and the query will be >> select date from table where customerid='100' and (date >="+combobox1.text+" && date <="+combobox2.text+" ) , hope this will solve ur problem.