Normal Topic Retrieving Current Month's records (Read 911 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Retrieving Current Month's records
Dec 28th, 2005 at 7:33pm
Print Post Print Post  
I am trying to retrieve records only in the current month and am stumbling (possibly because of Q & A programming).

I have indicated the following in a date element:

{@MONTH(DATE) = @MONTH(@DATE)}

No records are being returned by query even though I know there are a couple of records in the current month.

Does the above statement work ?

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Retrieving Current Month's records
Reply #1 - Dec 28th, 2005 at 8:03pm
Print Post Print Post  
Hello Louis,

Well one problem that I see is that you have an element named Date. Date is a reserved keyword and is going to cause problems.

One other thing that may be causing a trip-up is that retrieve spec programming uses field names instead of the element names that regular programming uses.

Other than that you will also need to put an AND statement in your retrieve so that it only gets the records for this month in this year. Something like

Code
Select All
{@Year(Date_Entered) = @Year(@Date) AND @Month(Date_Entered) = @Month(@Date)} 



The above code works in the sample customers file if you have records that have a Date_Entered value in this month and in this year.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Retrieving Current Month's records
Reply #2 - Dec 28th, 2005 at 8:09pm
Print Post Print Post  
Quote:
One other thing that may be causing a trip-up is that retrieve spec programming uses field names instead of the element names that regular programming uses.


What's the best way to determine the Field names when performing this type of search?

Quote:
Other than that you will also need to put an AND statement in your retrieve so that it only gets the records for this month in this year. Something like 

Code:
{@Year(Date_Entered) = @Year(@Date) AND @Month(Date_Entered) = @Month(@Date)}


The above code works in the sample customers file if you have records that have a Date_Entered value in this month and in this year.


Does the Q&A method of looking for a date with
]2005/12/..
still work?
  

**
Captain Infinity
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: Retrieving Current Month's records
Reply #3 - Dec 28th, 2005 at 8:23pm
Print Post Print Post  
Ray:

My element was actually called CHQ DATE and not DATE.  I wasn't thinking about that statement properly.

Thanks again for your expertise.

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Retrieving Current Month's records
Reply #4 - Dec 28th, 2005 at 8:26pm
Print Post Print Post  
Quote:
What's the best way to determine the Field names when performing this type of search?


Most of the time the Field name will be the same as the Element name. You can easily check in Sesame by opening Table View. The Column Headers in Table View are the Field names so you can get the name from there.


Quote:
Does the Q&A method of looking for a date with
]2005/12/..
still work?


Yes it does. In fact it is on page 236 of the 1.1 User Guide.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Retrieving Current Month's records
Reply #5 - Dec 29th, 2005 at 9:12pm
Print Post Print Post  
Quote:
You can easily check in Sesame by opening Table View. The Column Headers in Table View are the Field names so you can get the name from there.


I can only find a couple sentences in the manuals about Table View, so of course I have questions.  Smiley

1) Can number values be displayed in their formatted state, or are they always shown with the 6 trailing decimal places?

2) Can the order (left-to-right sequence) of coumns be re-arranged and made to stay that way?  Q&A allowed for the numbering of fields which determined the sequence of columns in Table View.  Is there something similar in Sesame?

3) Is there a way to make invisible LE's visible when in Table View?

4) When I perform a search and then switch to Table View of the result set, I can sort them by clicking the boxes at the top of the columns.  This doesn't seem to affect the sort of the result set, though, does it?  The sort has to be done before the Table View, is that right?

I realize that most of the above can be accomnplished by crafting a Report, but to tell the truth Sesame's reports multiply on my hard drive like NoSeeEm Bugs in Florida during the rainy season.  Undecided
  

**
Captain Infinity
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Retrieving Current Month's records
Reply #6 - Dec 30th, 2005 at 2:07pm
Print Post Print Post  
Quote:
1) Can number values be displayed in their formatted state, or are they always shown with the 6 trailing decimal places?

2) Can the order (left-to-right sequence) of coumns be re-arranged and made to stay that way?

To get around both of these issues, I ended creating a new form with my main db diplayed on it as a table-view subform. I still do almost all of my data adding/updating in the main db form, and just use the new form mainly for viewing the data as a table.

I also created a second main db form which only includes LEs that are bound to the fields that I want dispayed in the table-view subform. This way, I control which fields I see on the table, as well as the default width of the columns on the table. (The width of the LE in the form will determine the width of the column in the table.)

To clarify, the second main db form has LEs that are bound to the existing fields that were created with the original main db form. Do not create new fields, use the ones that are already in the db.

EDIT:
It's the second main db form that is selected for use as the table-view subform in the new form.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Retrieving Current Month's records
Reply #7 - Dec 30th, 2005 at 2:33pm
Print Post Print Post  
Quote:
1) Can number values be displayed in their formatted state, or are they always shown with the 6 trailing decimal places?


Version 2s Table View shows formatted values.

Quote:
2) Can the order (left-to-right sequence) of coumns be re-arranged and made to stay that way?  Q&A allowed for the numbering of fields which determined the sequence of columns in Table View.  Is there something similar in Sesame?


Version 2. Noticing a trend here? Wink

Quote:
3) Is there a way to make invisible LE's visible when in Table View?


Not without getting pretty tricky. Table View respects the visibility and read-only settings of the form Elements.

Quote:
4) When I perform a search and then switch to Table View of the result set, I can sort them by clicking the boxes at the top of the columns.  This doesn't seem to affect the sort of the result set, though, does it?  The sort has to be done before the Table View, is that right?


Sorting Table View has no affect on the sort order of the form in version 1. In version 2, both respect the Sort Spec.

The next Inside Sesame (coming out in a few days) includes a Version 2 Sneak Peek that shows the new Table View features, for those of you who did not make it to the Conference in Vegas.

Quote:
I realize that most of the above can be accomnplished by crafting a Report, but to tell the truth Sesame's reports multiply on my hard drive like NoSeeEm Bugs in Florida during the rainy season.  Undecided


You can write a batch file that clears them out if you don't want them. Personally, I've found it very useful to be able to go back and get a previously run report, so I don't clear mine very often. I have my SESAME_REPORT_PATH variable set, so they all go to the same place.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged