A String is required here

I am looking to run a report that only shows me the last 7 days of data.  This should be simple but I cannot get this to work for some reason.  Below is what I want to include and I keep getting an error that says a string is required here.  I am normally pretty good with Crystal but can't get past this.  Can anyone help me out here?

{RMA.RMA_DATE} = CurrentDAte - 7
LVL 5
Info TechIT DepartmentAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zephyr_hex (Megan)DeveloperCommented:
dateadd("d",-7,currentdate)

if {RMA.RMA_DATE} holds the date you are comparing against and you want all transactions that are within the past 7 days,
{RMA.RMA_DATE}>=dateadd("d",-7,currentdate)
0
Info TechIT DepartmentAuthor Commented:
When I use this {RMA.RMA_DATE}>=dateadd("d",-7,currentdate) I get the error saying "A Date-Time is required here and it highlights {RMA.RMA_DATE}

I think it is just a date field?
0
bdreed35Commented:
What is the datatype of the RMA.RMA_DATE field?  I suspect that it may not be a date or datetime field but actually a string.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Info TechIT DepartmentAuthor Commented:
Your exactly right that it is a string!  How do I go about doing what I want to accomplish here with that field being a string?
0
mlmccCommented:
Depending on the format of the field you need to convert it to a date.

It may be as simple as Date({RMA.RMA_DATE})
To get a DateTim,e use DateTime({RMA.RMA_DATE},Time(0,0,0))

If that doesn't work you will need to use left, mid and right to get the year, month, and day then convert them to date.

mlmcc
0
Info TechIT DepartmentAuthor Commented:
It looks like the format now is 2000/01/18 00:00:00:00

How do I go about fixing the string so i can compare it to CurrentDate - 7?
0
mlmccCommented:
Just like any other date field
Instead of using
{RMA.RMA_DATE}>=dateadd("d",-7,currentdate)

Use
{@YourFormula} >= dateadd("d",-7,currentdate)


mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Info TechIT DepartmentAuthor Commented:
What is the @YourFormula?
0
zephyr_hex (Megan)DeveloperCommented:
i believe his @YourFormula represents your converted string to date field.
0
Info TechIT DepartmentAuthor Commented:
How do I convert this string to date?  That was my original problem is I was unsure how to properly convert the string to date so I can compare?
0
mlmccCommented:
What is the format of the data you have?

mlmcc
0
Info TechIT DepartmentAuthor Commented:
I figured it out
The formula was DTSToDate ({RMA.RMA_DATE})
{@rmadate} in Last7Days

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Crystal Reports

From novice to tech pro — start learning today.