Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread dataset params - syntax
Mon, May 27 2013 11:55 AMPermanent Link

Paul Waegemans

IMS bvba

Avatar

I have a query already using 2 parameters

ZoekContacten1.Params.Clear;
ZoekContacten1.Params.Add('Volnaam='''+V_loginnaam+'''');
ZoekContacten1.Params.Add('Paswoord='''+V_loginpaswoord+'''');
Database.Load(ZoekContacten1);

I would like to add a third Parameter which is a date (Birthdate - see my other post with date problem...)

In the IDE the following query gives a correct result:

SELECT * FROM contacten WHERE volnaam={volnaam='WAEGEMANS PAUL'}
AND geboortedatum={geboortedatum='1951-03-07'}

The input of the date is through an TEdit (EdtGeboortedatum)  with syntax dd/MM/yyyy

How do I get it in the correct format for the parameter (dd/MM/yyy to yyyy/MM/dd)
Tue, May 28 2013 3:49 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Paul,

<< The input of the date is through an TEdit (EdtGeboortedatum)  with syntax
dd/MM/yyyy

How do I get it in the correct format for the parameter (dd/MM/yyy to
yyyy/MM/dd) >>

Convert the text to a date using StrToDate(), and then build the proper
string using a '-' separator and IntToStr on the values returned by these
functions on the date value:

http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=YearOf
http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=MonthOf
http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=DayOf

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, May 29 2013 5:26 PMPermanent Link

Paul Waegemans

IMS bvba

Avatar

This works:
V_logingeboortedatum:=IntToStr(YearOf(StrToDate(T_EdtGeboorteDatum.text)))+'-'+
                                  IntToStr(MonthOf(StrToDate(T_EdtGeboorteDatum.text)))+'-'+
                                  IntToStr(DayOf(StrToDate(T_EdtGeboorteDatum.text)));

To test if a user is already registered I ask to put in firstname,lastname and birthdate. But as I told you of the problem of the date 07/09/1972 is saved as 06/09/1972 I can not rely on this test to prevent the double input of a contactperson.  What would you suggest?



"Tim Young [Elevate Software]" wrote:

Paul,

<< The input of the date is through an TEdit (EdtGeboortedatum)  with syntax
dd/MM/yyyy

How do I get it in the correct format for the parameter (dd/MM/yyy to
yyyy/MM/dd) >>

Convert the text to a date using StrToDate(), and then build the proper
string using a '-' separator and IntToStr on the values returned by these
functions on the date value:

http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=YearOf
http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=MonthOf
http://www.elevatesoft.com/manual?action=viewtopic&id=ewb1&topic=DayOf

If you have any other questions, please let me know.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, May 30 2013 1:30 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Paul,

<< To test if a user is already registered I ask to put in
firstname,lastname and birthdate. But as I told you of the problem of the
date 07/09/1972 is saved as 06/09/1972 I can not rely on this test to
prevent the double input of a contactperson.  What would you suggest? >>

That's a bug, so once it's fixed you won't have an issue anymore.

Tim Young
Elevate Software
www.elevatesoft.com
Image