string and date time error message - when using on the same formula-fieldNumber to String in a formula fieldCrystal Reports 2008: field shows as blank even when data is returned from the database?Formula won't display when certain fields are nullReturn different datatypes crystal formulaMaking a Text Field a Link to a Sub-ReportCR is showing default value 6 when it should be showing 0Where do I get the DB field to base a Crystal formula on?Crystal Reports Rounding IssuesCrystal Report formula error when accessed from VB.NET 2015CECrystal Reports Using an IF formula with summary of summary fields

What is a plausible power source to indefinitely sustain a space station?

What rules turn any attack that hits a given target into a critical hit?

What is "ass door"?

If I have the Armor of Shadows Eldritch Invocation do I know the Mage Armor spell?

Is it better to merge "often" or only after completion do a big merge of feature branches?

Is the apartment I want to rent a scam?

How can I print a 1 cm overhang with minimal supports?

Were the Apollo broadcasts recorded locally on the LM?

Adding gears to my grandson's 12" bike

How can I calculate the cost of Skyss bus tickets

Considerations when providing money to one child now, and the other later?

How can Kazakhstan perform MITM attacks on all HTTPS traffic?

Book in which the "mountain" in the distance was a hole in the flat world

Wiring IKEA light fixture into old fixture

German phrase for 'suited and booted'

Is it OK to accept a job opportunity while planning on not taking it?

Are there any English words pronounced with sounds/syllables that aren't part of the spelling?

How does mathematics work?

What does the following chess proverb mean: "Chess is a sea where a gnat may drink from and an elephant may bathe in."

What kind of anatomy does a centaur have?

Does Impedance Matching Imply any Practical RF Transmitter Must Waste >=50% of Energy?

Why does the salt in the oceans not sink to the bottom?

My current job follows "worst practices". How can I talk about my experience in an interview without giving off red flags?

Found more old paper shares from broken up companies



string and date time error message - when using on the same formula-field


Number to String in a formula fieldCrystal Reports 2008: field shows as blank even when data is returned from the database?Formula won't display when certain fields are nullReturn different datatypes crystal formulaMaking a Text Field a Link to a Sub-ReportCR is showing default value 6 when it should be showing 0Where do I get the DB field to base a Crystal formula on?Crystal Reports Rounding IssuesCrystal Report formula error when accessed from VB.NET 2015CECrystal Reports Using an IF formula with summary of summary fields






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am new to CR and trying to get an invoice formula to read sometimes as a date and sometimes as a text. This depends on the "terms code" for the customer how they should pay: there are only 4 codes, and sometimes it is blank.



I tried with different syntax using



str() or totext 


but I do not know the right formatting. See below for my attempt :)



if isnull(PAYTERMS.TERMSCODE) then INVOICE.DATE
else if PAYTERMS.TERMSCODE=1 then INVOICE.DATE+30
else if PAYTERMS.TERMSCODE=2 then INVOICE.DATE+45
else if PAYTERMS.TERMSCODE=3 then INVOICE.DATE
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else INVOICE.DATE


It keeps returning an error:




a date is required here











share|improve this question
























  • Can you change the property name of Invoice? The error is speaking itself.

    – JulyOrdinary
    Mar 26 at 15:16

















0















I am new to CR and trying to get an invoice formula to read sometimes as a date and sometimes as a text. This depends on the "terms code" for the customer how they should pay: there are only 4 codes, and sometimes it is blank.



I tried with different syntax using



str() or totext 


but I do not know the right formatting. See below for my attempt :)



if isnull(PAYTERMS.TERMSCODE) then INVOICE.DATE
else if PAYTERMS.TERMSCODE=1 then INVOICE.DATE+30
else if PAYTERMS.TERMSCODE=2 then INVOICE.DATE+45
else if PAYTERMS.TERMSCODE=3 then INVOICE.DATE
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else INVOICE.DATE


It keeps returning an error:




a date is required here











share|improve this question
























  • Can you change the property name of Invoice? The error is speaking itself.

    – JulyOrdinary
    Mar 26 at 15:16













0












0








0








I am new to CR and trying to get an invoice formula to read sometimes as a date and sometimes as a text. This depends on the "terms code" for the customer how they should pay: there are only 4 codes, and sometimes it is blank.



I tried with different syntax using



str() or totext 


but I do not know the right formatting. See below for my attempt :)



if isnull(PAYTERMS.TERMSCODE) then INVOICE.DATE
else if PAYTERMS.TERMSCODE=1 then INVOICE.DATE+30
else if PAYTERMS.TERMSCODE=2 then INVOICE.DATE+45
else if PAYTERMS.TERMSCODE=3 then INVOICE.DATE
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else INVOICE.DATE


It keeps returning an error:




a date is required here











share|improve this question
















I am new to CR and trying to get an invoice formula to read sometimes as a date and sometimes as a text. This depends on the "terms code" for the customer how they should pay: there are only 4 codes, and sometimes it is blank.



I tried with different syntax using



str() or totext 


but I do not know the right formatting. See below for my attempt :)



if isnull(PAYTERMS.TERMSCODE) then INVOICE.DATE
else if PAYTERMS.TERMSCODE=1 then INVOICE.DATE+30
else if PAYTERMS.TERMSCODE=2 then INVOICE.DATE+45
else if PAYTERMS.TERMSCODE=3 then INVOICE.DATE
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else INVOICE.DATE


It keeps returning an error:




a date is required here








crystal-reports crystal-reports-2010






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 16:12









MatSnow

5,5662 gold badges13 silver badges27 bronze badges




5,5662 gold badges13 silver badges27 bronze badges










asked Mar 26 at 14:38









bstandbstand

103 bronze badges




103 bronze badges












  • Can you change the property name of Invoice? The error is speaking itself.

    – JulyOrdinary
    Mar 26 at 15:16

















  • Can you change the property name of Invoice? The error is speaking itself.

    – JulyOrdinary
    Mar 26 at 15:16
















Can you change the property name of Invoice? The error is speaking itself.

– JulyOrdinary
Mar 26 at 15:16





Can you change the property name of Invoice? The error is speaking itself.

– JulyOrdinary
Mar 26 at 15:16












1 Answer
1






active

oldest

votes


















0














The result of the formula must be of the same datatype, you can't mix dates and strings.
So you have to convert the dates to string.



There's no str()-function in Crystal Reports as far as I know. I guess you mean cstr().

It does not matter if you use the cstr() or totext() because totext() is just an alias for cstr().



The formula should look as follows:



if isnull(PAYTERMS.TERMSCODE) then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=1 then cstr(INVOICE.DATE+30)
else if PAYTERMS.TERMSCODE=2 then cstr(INVOICE.DATE+45)
else if PAYTERMS.TERMSCODE=3 then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else cstr(INVOICE.DATE)


Additionally you can set the second argument of cstr() to define the output format of the date:



cstr(INVOICE.DATE, "MM/dd/yyyy") // Output will be like "03/26/2019"





share|improve this answer























  • thanks so much! i thought i was close :)

    – bstand
    Mar 27 at 20:00










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55359827%2fstring-and-date-time-error-message-when-using-on-the-same-formula-field%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














The result of the formula must be of the same datatype, you can't mix dates and strings.
So you have to convert the dates to string.



There's no str()-function in Crystal Reports as far as I know. I guess you mean cstr().

It does not matter if you use the cstr() or totext() because totext() is just an alias for cstr().



The formula should look as follows:



if isnull(PAYTERMS.TERMSCODE) then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=1 then cstr(INVOICE.DATE+30)
else if PAYTERMS.TERMSCODE=2 then cstr(INVOICE.DATE+45)
else if PAYTERMS.TERMSCODE=3 then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else cstr(INVOICE.DATE)


Additionally you can set the second argument of cstr() to define the output format of the date:



cstr(INVOICE.DATE, "MM/dd/yyyy") // Output will be like "03/26/2019"





share|improve this answer























  • thanks so much! i thought i was close :)

    – bstand
    Mar 27 at 20:00















0














The result of the formula must be of the same datatype, you can't mix dates and strings.
So you have to convert the dates to string.



There's no str()-function in Crystal Reports as far as I know. I guess you mean cstr().

It does not matter if you use the cstr() or totext() because totext() is just an alias for cstr().



The formula should look as follows:



if isnull(PAYTERMS.TERMSCODE) then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=1 then cstr(INVOICE.DATE+30)
else if PAYTERMS.TERMSCODE=2 then cstr(INVOICE.DATE+45)
else if PAYTERMS.TERMSCODE=3 then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else cstr(INVOICE.DATE)


Additionally you can set the second argument of cstr() to define the output format of the date:



cstr(INVOICE.DATE, "MM/dd/yyyy") // Output will be like "03/26/2019"





share|improve this answer























  • thanks so much! i thought i was close :)

    – bstand
    Mar 27 at 20:00













0












0








0







The result of the formula must be of the same datatype, you can't mix dates and strings.
So you have to convert the dates to string.



There's no str()-function in Crystal Reports as far as I know. I guess you mean cstr().

It does not matter if you use the cstr() or totext() because totext() is just an alias for cstr().



The formula should look as follows:



if isnull(PAYTERMS.TERMSCODE) then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=1 then cstr(INVOICE.DATE+30)
else if PAYTERMS.TERMSCODE=2 then cstr(INVOICE.DATE+45)
else if PAYTERMS.TERMSCODE=3 then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else cstr(INVOICE.DATE)


Additionally you can set the second argument of cstr() to define the output format of the date:



cstr(INVOICE.DATE, "MM/dd/yyyy") // Output will be like "03/26/2019"





share|improve this answer













The result of the formula must be of the same datatype, you can't mix dates and strings.
So you have to convert the dates to string.



There's no str()-function in Crystal Reports as far as I know. I guess you mean cstr().

It does not matter if you use the cstr() or totext() because totext() is just an alias for cstr().



The formula should look as follows:



if isnull(PAYTERMS.TERMSCODE) then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=1 then cstr(INVOICE.DATE+30)
else if PAYTERMS.TERMSCODE=2 then cstr(INVOICE.DATE+45)
else if PAYTERMS.TERMSCODE=3 then cstr(INVOICE.DATE)
else if PAYTERMS.TERMSCODE=4 then "Upon Receipt"
else cstr(INVOICE.DATE)


Additionally you can set the second argument of cstr() to define the output format of the date:



cstr(INVOICE.DATE, "MM/dd/yyyy") // Output will be like "03/26/2019"






share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 26 at 16:10









MatSnowMatSnow

5,5662 gold badges13 silver badges27 bronze badges




5,5662 gold badges13 silver badges27 bronze badges












  • thanks so much! i thought i was close :)

    – bstand
    Mar 27 at 20:00

















  • thanks so much! i thought i was close :)

    – bstand
    Mar 27 at 20:00
















thanks so much! i thought i was close :)

– bstand
Mar 27 at 20:00





thanks so much! i thought i was close :)

– bstand
Mar 27 at 20:00








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55359827%2fstring-and-date-time-error-message-when-using-on-the-same-formula-field%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript