Title: sqlgetvar shortcode
Last modified: August 31, 2016

---

# sqlgetvar shortcode

 *  Resolved [aamay001](https://wordpress.org/support/users/aamay001/)
 * (@aamay001)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sqlgetvar-shortcode/)
 * Hi Eli,
 * First off, thanks for such a great plug-in!
 * I’m trying to use the [sqlgetvar] short code but I am not getting any output.
   I have created a report that returns a single column with a single row. I need
   the value to displayed without the table.
 * Here is the code I’m using (it’s tested and returns the correct value as a report):
 * `SELECT TRIM(SUBSTRING( SUBSTRING( p.post_content, INSTR(p.post_content, 'Event
   Poster') + 19, 256 ), 1, INSTR(SUBSTRING( p.post_content, INSTR(p.post_content,'
   Event Poster') + 19, 256 ), ' show_in_lightbox="on"' ) - 2 ) ) AS Poster FROM
   wp_posts p INNER JOIN wp_term_relationships tr ON tr.object_id = p.id INNER JOIN
   wp_term_taxonomy tt ON tt.term_taxonomy_id = tr.term_taxonomy_id INNER JOIN wp_terms
   t ON t.term_id = tt.term_id WHERE p.post_type = 'project' AND p.post_status ='
   publish' AND tt.taxonomy = 'project_category' AND p.post_title <> '' AND DATE_FORMAT(
   STR_TO_DATE((SELECT meta_value FROM wp_postmeta WHERE post_id = p.id AND meta_key
   = 'inba_event_date' LIMIT 1 ), '%m/%d/%Y'), '%m/%d/%Y') > DATE_FORMAT(NOW(), '%
   m/%d/%Y' ) ORDER BY DATE_FORMAT(STR_TO_DATE((SELECT meta_value FROM wp_postmeta
   WHERE post_id = p.id AND meta_key = 'inba_event_date' LIMIT 1 ), '%m/%d/%Y'),'%
   m/%d/%Y') ASC LIMIT 1`
 * Are there any limitations to the [sqlgetvar] shortcode?
 * Your help is greatly appreciated.
 * Thanks,
 * Andy
 * [https://wordpress.org/plugins/elisqlreports/](https://wordpress.org/plugins/elisqlreports/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [aamay001](https://wordpress.org/support/users/aamay001/)
 * (@aamay001)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/sqlgetvar-shortcode/#post-7141656)
 * Eli,
 * Don’t worry about this. I got it to work by creating a stored procedure and then
   just called the stored procedure.
 * Thanks,
 * Andy

Viewing 1 replies (of 1 total)

The topic ‘sqlgetvar shortcode’ is closed to new replies.

 * ![](https://ps.w.org/elisqlreports/assets/icon-256x256.png?rev=1231385)
 * [EZ SQL Reports Shortcode Widget and DB Backup](https://wordpress.org/plugins/elisqlreports/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/elisqlreports/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/elisqlreports/)
 * [Active Topics](https://wordpress.org/support/plugin/elisqlreports/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/elisqlreports/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/elisqlreports/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [aamay001](https://wordpress.org/support/users/aamay001/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/sqlgetvar-shortcode/#post-7141656)
 * Status: resolved