There's no way that 1:1 works in phpMyAdmin due to the prefix and substitution which neither would process in phpMyAdmin. The below example provides the flexibility of telling you how many days since the users last visit.
Code:
SELECT DATEDIFF( NOW(), `lastview` ) FROM `#__comprofiler_views` WHERE `profile_id` = '[user_id]' AND `viewer_id` = '[cb:userdata field="user_id" user="#me" /]'
Example results as follows.
Date: 2015-03-09 14:31:30
Difference: 23 Days
Result: 23
Please understand we do not provide custom coding here. We are not here to write custom code or debug your custom coding for you. I've already informed you of this multiple times. Future requests will be ignored or deleted. We've no issues providing simple examples to get you started, but we're not here to provide you with specific code.
When using a plugin like CB Query Field which simply sends your string through SQL you are expected to debug your own code. It's simply a tool to pass your string along to MYSQL functions and nothing more; it not functioning is guaranteed to be a problem with the query directly. As always be sure debug mode and maximum error reporting is set in Joomla global configuration while testing so you can see error output if the query should fail as well as allows you to debug the query being sent to MYSQL in Joomlas debug display at the bottom of the page.
If you need custom coding you should consult with a contract developer as needed.