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
mfehrmannAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mlmccConnect With a Mentor Commented:
Just like any other date field
Instead of using
{RMA.RMA_DATE}>=dateadd("d",-7,currentdate)

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


mlmcc
0
 
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
 
mfehrmannAuthor 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
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
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
 
mfehrmannAuthor 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
 
mfehrmannAuthor 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
 
mfehrmannAuthor Commented:
What is the @YourFormula?
0
 
zephyr_hex (Megan)DeveloperCommented:
i believe his @YourFormula represents your converted string to date field.
0
 
mfehrmannAuthor 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
 
mfehrmannAuthor Commented:
I figured it out
The formula was DTSToDate ({RMA.RMA_DATE})
{@rmadate} in Last7Days

0
All Courses

From novice to tech pro — start learning today.