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 problem not solved

Status
Not open for further replies.

misulica

Programmer
Feb 8, 2003
43
RO
In designer mode for click command, the first line is:
_date = CTOD(STR(1)+MONTH(DATE())+YEAR(DATE()))

When I select this line, right-click and Execute Selection, I receive the message:
Operator/operand type mismatch

???Thanks
 
misulica

The above code gives me an error also. I'm not sure who suggested it but it does not work, since the first section:
CTOD(STR(1) is suppose to transform a string (1) to a date format (the string being characters)and the rest MONTH() and Year are numeric values which cannot be assembled together.
What are you looking to do? Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I want to save the date and the price of each product sold in a table, so I can use later for a chart
 
It should be something like:

_date = CTOD('01/+'tran(MONTH(DATE()),'@L 99')+'/'+tran(YEAR(DATE()),'9999') )

Rob.
 
One small typo:


_date = CTOD('01/'+tran(MONTH(DATE()),'@L 99')+'/'+tran(YEAR(DATE()),'9999') )

This should work fine!

Rob.
 
misulica

It works indeed, thank you

I still do not comprehend with you need such a function when
_date = date()

Would be a lot more simple. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
It would have to be:

_date = date() - day(date()) + 1

in order to get the first day of the month...

Rob.
 
There are a many proposed solutions for date calculations in thread184-372056. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top