Normal Topic String in a date field (Read 1369 times)
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
String in a date field
Aug 15th, 2006 at 1:24am
Print Post Print Post  
I'm having an issue with trying to retrieve records with one of the retrieve criteria being in a date field.

var vCombo as String
VCombo = Start_Date0 + ".." + End_Date0
(Entered is a Date element)
(Temp is Text element)

(Start_Date0 is a Text element populated with popup calendar)
(End_Date0 is a Text element populated with ppup calendar)
Start date selected is 2006/06/01
End date selected is 2006/07/31

Report launched by command button.
Programming, in part:
Temp = vCombo
Entered = vCombo

WriteLn returns results as:
Temp = 2006/06/01..2006/07/31
Entered = 0000/00/00

If I try @Str(Temp) or @Str(vCombo) the result is 2006/06/01 -- only the Start_Date appears.

I've tried playing with FormFieldValue and @FormFieldValue with no luck.

I guess the question is, how do I get the Entered element to accept a String with the date range 2006/06/01..2006/07/31 like the Temp element accepts?

Thanks in advance for your support!
Fred
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: String in a date field
Reply #1 - Aug 15th, 2006 at 1:32am
Print Post Print Post  
NICEBERG wrote on Aug 15th, 2006 at 1:24am:
I've tried playing with FormFieldValue and @FormFieldValue with no luck.


FormFieldValue is how you do this. What did you try that didn't work?  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
Re: String in a date field
Reply #2 - Aug 15th, 2006 at 1:36am
Print Post Print Post  
Hi Erika,

This is one of the attempts with FormFieldValue:

FormFieldValue(@Layout, "Entered", 0, Start_Date0 + ".." + End_Date0)

That returns 0000/00/00

Another was:

FormFieldValue(@Layout, "Entered", Start_Date0,0 + ".." + End_Date0)

That returns 2000/08/15 (SIC)
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: String in a date field
Reply #3 - Aug 15th, 2006 at 1:46am
Print Post Print Post  
What mode is the form in?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
Re: String in a date field
Reply #4 - Aug 15th, 2006 at 1:50am
Print Post Print Post  
Search (blue)
  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: String in a date field
Reply #5 - Aug 15th, 2006 at 1:52am
Print Post Print Post  
I just set programming in the on retrieve open event to
Code
Select All
FormFieldValue("Main Form", "Date_Entered", 1, "12/7/1961..12/7/2001")
 



and it stuck like glue. Is your programming in the retrieve spec open event?
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
Re: String in a date field
Reply #6 - Aug 15th, 2006 at 2:04am
Print Post Print Post  
No - it's an on element entry for a command button.

Sequence is:
Combo box for Equipment - captured to variable
Select Start_Date from popup calendar (down arrow element pops up calendar and fills element "Select_Start_Date)
Select End_Date (ditto above)

Select command button which fills a field "Status" with UNP;
inputs the Equipment variable that was saved to an element named Equip
SUPPOSED TO take info from Start_Date, add two periods, and add data from End_Date to element Entered. Then uses SelectTreeItem to retrieve records.

But I'll go play with the Retrieve Spec Open event!
« Last Edit: Aug 15th, 2006 at 3:37am by NICEBERG »  
Back to top
 
IP Logged
 
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
Re: String in a date field
Reply #7 - Aug 15th, 2006 at 2:18am
Print Post Print Post  
I'm actually modifying a form that worked well before. Similar setup.

Combobox with numbers 30-60-90-180-365. Saved to var vDaynumb as Int
Equip combobox to select equip

Programming was:
FormFieldValue(@Layout, "Entered", 0, @Str(@Date - vDaynumb) + ".." + @Date)
This was in the "on element entry" on a command button.

This worked super!
I thought it'd be nicer to pop up a calendar and select starting and ending dates, so I added the new elements to do this. I then thought all I would need to do was replace the programming beginning with "@Str" with the new element names. No luck!
  
Back to top
 
IP Logged
 
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
Re: String in a date field
Reply #8 - Aug 15th, 2006 at 2:36am
Print Post Print Post  
The real question is - if I can can a text element named Temp to produce the desired results, 2006/06/01..2006/07/31, why wouldn't a simple statement like Entered=Temp work? Temp is a text field, and Entered is a date field, but being in the Search(blue)mode, the date field should accept a string from a text field, shouldn't it?

Also, since WriteLn shows the string 2006/06/01..2006/07/31 for Temp element I tried the following:
FormFieldValue(@Layout, "Entered", 1, Temp)
This returned: 2006/06/01 in WriteLn for Entered

TOTALLY confused - and about to start a second glass of wine!! (That always helps the creative mind, doesn't it??)

Also, is it possible to change an element from a bound to "Date" to a bound to "Text"? That'd probably solve this issue.

Am willing to send .dsr and .ddt files for evaluation. Was that to Support@lantica.com?
  
Back to top
 
IP Logged
 
NICEBERG
Full Member
Members
***
Offline


I came, I saw, I'm still
trying to figure it out!

Posts: 208
Location: Green Bay, WI
Joined: Dec 17th, 2003
Re: String in a date field
Reply #9 - Aug 15th, 2006 at 4:35am
Print Post Print Post  
Never mind - I got it on the third glass!! LOL

I changed my Start_Date and End_Date fields back to DATE elements, and then eliminated the "temp" field - and magic! I THOUGHT I started out that way, but must have made a wrong turn and kept going down the wrong road. It's always easy once you figure it out!! Only put 5-1/2 hours into it. Tongue

I sure learned a lot about GlobalValues, Reports and a LOT of other cool things about this great program. Look out, I'll either be very dangerous or a REAL pest. Grin

Thanks to all who responded!!
'Night
Fred

P.S. Erika - you were right, again. I used:
FormFieldValue(@Layout, "Entered", 0, vCombo)
  
Back to top
 
IP Logged