help concatening some fields

Hi,

I need to concatenate some fields in one field fo build an special id

I have these fields

id - int(11)
id_cliente - int(11)
fecha - date

I use ajax event with the next line

{folio} = {id}." / “.{id_cliente}.” / ".{fecha};

I need the next result folio (varchar (100)) = 1 / 25 / 2011

But don?t works

If I try

{folio} = “Hi”." World";

Works fine

Please tell me how solve this, thanks

Eduardo Cazares

Re: help concatening some fields

Wy ajax? I use Onload or onLoadRecord events to do these kind of operations. Your code should work there.

{folio} = {id}." / “.{id_cliente}.” / ".{fecha};

Re: help concatening some fields

Thanks Freezer,

It works.

Now, do you know how can I substract only the year of the date field?

The result of concatening is

folio = 3 / 1 / 2011-02-09

And I need …

folio = 3 / 1 / 2011

Thanks in advance

Eduardo Cazares

Re: help concatening some fields

use one of there PHP functions to achieve this:
substr() -> http://www.php.net/manual/en/function.substr.php
date() -> http://www.php.net/manual/en/function.date.php

Re: help concatening some fields

Thanks a lot,

I think I can only use macros of scriptcase, the solution that you give me works fine, thanks

Eduardo Cazares