Quantcast
Channel: VBForums - Reporting
Viewing all articles
Browse latest Browse all 594

Mysql + Crystal report (Show records more than 1 year)

$
0
0
I am looking for records for the past 1 year.

Example:
January 21, 2013
January 21, 2014
November 6, 2015 This record should not appear. Not more than 1 year.

This is how I do this in SQL Statement
Code:

strQuery = "SELECT * FROM tbl_sample WHERE " _
          & "Month(DateHired) = 11 AND " _
          & "DateHired <= DATE_ADD(CURDATE(), INTERVAL -1 YEAR)"

How about in crxReport.RecordSelectionFormula?

Code:

    Dim strFill As String
   
    strFill = "{tbl_sample.DateHired} <= DATE_ADD(CURDATE(), INTERVAL -1 YEAR)"
    crxReport.RecordSelectionFormula = strFill

I have no luck using these codes.... Any Idea?
Thanks in advance.

Viewing all articles
Browse latest Browse all 594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>