5 Replies - 2355 Views - Last Post: 30 December 2012 - 09:59 PM Rate Topic: -----

#1 Des DC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 28-December 12

An error of "A Date is required here." in crystal report

Posted 28 December 2012 - 06:20 PM

Hi all,
I need to convert the power builder code in vb.net.
this is the power builder code
receiptdate +" ("+Mid(Upper(dayname( receiptdate )) ,1,3)+")"


I tried to convert it like this
stringvar ReceiptDate = {DataTable1.ReceiptDate};
numbervar dayname = Mid(UpperCase(Day( {DataTable1.ReceiptDate})) ,1,3);
cstr(ReceiptDate) & cstr(dayname);


but when i want to save it in crystal report,it come out an error state that "A date is required."
Can anyone guide me how to solve it? Or is there any website that have tutorial about declaring variable in crystal report vb.net?

Is This A Good Question/Topic? 0
  • +

Replies To: An error of "A Date is required here." in crystal report

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1053
  • View blog
  • Posts: 4,081
  • Joined: 02-July 08

Re: An error of "A Date is required here." in crystal report

Posted 28 December 2012 - 07:37 PM

Try the ToText function.
Was This Post Helpful? 0
  • +
  • -

#3 Des DC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 28-December 12

Re: An error of "A Date is required here." in crystal report

Posted 28 December 2012 - 09:26 PM

_HAWK_,
Thanks for reply.
I tried
Datevar ReceiptDate := Date({DataTable1.ReceiptDate});
stringvar dayofreceipt := Totext(Day (ReceiptDate));
stringvar dayname = Mid((UpperCase((dayofreceipt))) ,1,3) ;
cstr(ReceiptDate) & cstr(dayofreceipt);


There is no more error. But my output cannot display the day. It only can display the date.
I wish to get the output like "01/09/2012(SAT)"
but now it only display "01/09/2012".
Is there something missing in my coding?
Was This Post Helpful? 0
  • +
  • -

#4 Des DC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 28-December 12

Re: An error of "A Date is required here." in crystal report

Posted 28 December 2012 - 09:36 PM

Sorry,I just checked the output again.
The output is "01/09/20121.00" not "01/09/2012"
Sorry for the mistake.
Was This Post Helpful? 0
  • +
  • -

#5 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1053
  • View blog
  • Posts: 4,081
  • Joined: 02-July 08

Re: An error of "A Date is required here." in crystal report

Posted 28 December 2012 - 09:39 PM

The ToText function changes the Date to a string in the format you provide - it is in the link -> scroll down to the date part.
Was This Post Helpful? 0
  • +
  • -

#6 Des DC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 28-December 12

Re: An error of "A Date is required here." in crystal report

Posted 30 December 2012 - 09:59 PM

_HAWK_,sorry for late reply.
Anyway,thanks for your reply and help.
I solved the problem by changing the format of the data. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1