Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date Parmeter with format : mm/yy

Status
Not open for further replies.

svm

Programmer
Apr 26, 2001
44
US
The field is being defined is the file as ExpDeliveryDate with Data Type nvarchar. What I wanna do is to have a record selection that will only accept tblProjectInfo.ExpDeliveryDate = DateParm

Since I am new to this crystal report, how do you define the parameter when you create one to only accept mm/yy as the format. Then how do you define your record selection to accept only records in the file = the Date Parameter you are submitting. Appreciate any help you can give me. Thank you very much.
 
Your mm/yy needs to be string parameter - your users would type in the date such as 09/01, and you can use the record selection formula as you have written it.
You could also add an edit mask of 00/00 to this parameter, to force the user to enter a two digit month, followed by a two digit year.
 
I tried doing it but it doesn't select records equal or greater than the parameter entered which is the date in format mm/yy. When I am scanning the data I tried to find out even less than the date entered is still printing. What is the best solution for this.

Thanks.
 
Yes, it won't sort correctly if the year is last. I would create a string parameter, with the mask as described above, and then use this selection formula:

{field} [4 to 5] + {field} [1 to 2]

>=

{?param} [4 to 5] + {?param} [1 to 2] Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Should this one look like this formula.

{TblBidInfo.BidDate} [7 to 10] + {TblBidInfo.BidDate} [4 to 5] + {TblBidInfo.BidDate} [1 to 2]
> =
{?Enter Beginning Date Range} [7 to 10] + {?Enter Beginning Date Range} [4 to 5] + {?Enter Beginning Date Range} [1 to 2]

and

{TblBidInfo.BidDate} [7 to 10] + {TblBidInfo.BidDate} [4 to 5] + {TblBidInfo.BidDate} [1 to 2]
> =
{?Enter Ending Date Range} [7 to 10] + {?Enter Ending Date Range} [4 to 5] + {?Enter Ending Date Range} [1 to 2]


tblBidInfo.BidDate is the field that contains the date with a datatype nvarchar and has a format mm/dd/yyyy. The parameters{?Enter Beginning Date Range} & {?Enter Ending Date Range} has an edit mask of "00/00/0000". I defined this in Record Selection Formula Editor. What is wrong in my syntax. Thanks.
 
why are you using

> =

both times?
Are you getting a syntax error message or just the wrong records? Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
I'm getting a syntax error.
 
I'm getting a syntax error.
 
> = should not have a space between - use
>= instead.
One of them should be
<= also
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top