If period is a date field in your DB you need to have period as a numeric delimited value rather than as a text delimited value -
Month (Period) evaluates to a number not to text
- you can also combine the = and > as one test >=
(PN=':
N::' AND Month(Period)>=" & Month(Date()) & " AND Year(Period)>=" & Year(Date()) )
--
_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________
|
| With a great deal of help using current server date as query date has now
| been achieved and we can get results. However we really need to use the
| current date as our defalt date instead of inserting a current date into the
| Frontpage DBRW reason is we are setting up lots of pages rather than one page
| for editing by individual clients
|
| Following are our field values and queries, our objective is to access
| results or editor and have the default (current month) show up as the default
| result then be able to search for different months
|
| Fields are
|
| PN - a numeric value that is put into the query by either hyperlink or
| default in Frontpage Database Wizard
|
| Period is a month represented by for example 10/1/2007 being October 1 2007
|
| Current date SQL is either (equal) Month(Period)="" & Month(Date()) & "" AND
| Year(Period)= "" & Year(Date()) (or greater than) Month(Period) > "" &
| Month(Date()) & "" AND Year(Period)= "" & Year(Date())
|
|
| Queries are
|
| (PN = :
N:: AND Period = ':
eriod::')
|
| (PN = :
N:: AND (Period = ':
eriod::' OR Period > ':
eriod::'))
|
| (Period > ':
eriod::' AND PN = ':
N::')
|
| (Period = ':
eriod::' AND PN = ':
N::')
|
| Any help in showing us how to include the current month as a default in
| these queries would be greatly appreciated thank you, we have tried several
| ways but get either weird or no result.
|
| "Stefan B Rusynko" wrote:
|
| > Just
| >
| > WHERE (PN = ':
N::' AND Month(Period)>"" & Month(Date()) & "" AND
| > Year(Period)= "" & Year(Date()) )
| >
| >
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > _____________________________________________
| >
| >
| > | > | Stefan may I ask one more question on this please how do I get Perior =
| > | greater than current month? Tried
| > |
| > | WHERE (Period > ( Month(Period)="" & Month(Date()) & "" AND Year(Period)= ""
| > | & Year(Date()) ) AND PN = ':
N::' )
| > |
| > |
| > | But got current month still
| > |
| > | Again thank you
| > |
| > |
| > | "Russell New zealand" wrote:
| > |
| > | > Thank you Stefan
| > | >
| > | > Looking good and works, just had to play with the sytax and got a result on
| > | >
| > | > WHERE (PN = ':
N::' AND Month(Period)="" & Month(Date()) & "" AND
| > | > Year(Period)= "" & Year(Date()) )
| > | >
| > | > This has been troubling me for days!
| > | >
| > | > "Stefan B Rusynko" wrote:
| > | >
| > | > > Try
| > | > > WHERE (PN = ':
N::' AND Month(Period)=" & Month(Date()) & " AND Year(Period)=" &
| > | > > Year(Date()) )
| > | > >
| > | > >
| > | > > --
| > | > >
| > | > > _____________________________________________
| > | > > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > | > > "Warning - Using the F1 Key will not break anything!" (-;
| > | > > _____________________________________________
| > | > >
| > | > >
| > | > > | > | > > |I am trying to set up a query in custom query to return field values in my
| > | > > | database based on current date base on year and month only using format of
| > | > > | mm/dd/yyy where dd will be a wild card value (I think?) have tried several
| > | > > | options such as
| > | > > |
| > | > > | WHERE (PN = ':
N::' AND Period = '" & MonthName(Month(Date)) & " " &
| > | > > | Year(Date) & "')
| > | > > |
| > | > > | WHERE (PN = ':
N::' AND Period = '" & Monthname(Date) & "/01/" & Year(Date)
| > | > > | & "')
| > | > > |
| > | > > | WHERE (PN = ':
N::' AND Period = '" & (Month(Date) & "1" & Year(Date) & "')
| > | > > |
| > | > > | WHERE (PN = ':
N::' AND Period = '" & (Month(Date) & "/01/" & Year(Date) &
| > | > > | "')
| > | > > |
| > | > > | PN is another field
| > | > > |
| > | > > | But no luck
| > | > > |
| > | > > | If anyone has any ideas it would be greatly appreciated
| > | > > |
| > | > > | trying to avoid using the defalt date as we would then have a lot of pages
| > | > > | to update each month
| > | > > |
| > | > > | Thank you
| > | > >
| > | > >
| > | > >
| >
| >
| >