Sabtu, 25 Juni 2011

RE: [MS_AccessPros] How do I make the query I need?

 

Edgar-

If the underlying field is Date/Time, adding a number of days *will* give you
the correct month in the future. The month display using Format has no bearing
on what's actually stored.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of
xtintores@yahoo.com
Sent: Saturday, June 25, 2011 1:53 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: Re: [MS_AccessPros] How do I make the query I need?

Ok John, but the problem I see doing it that way is for example, if the service
was done in febuary 1st, and the next service is 6 months latter, and the
interval says 180 days, than it would realy show up to be july for the next
service date. Keep in mind that both the service date and the next service date
are both formated to "mmm" to show only the month of service scince the service
can be done at any time during that month. This is because the NFPA code says
service should be done every so many months, sometimes monthly. The thing is
adding days to a date won't allways give me the right month for text service.

Any sugestions?

Sent from my BlackBerryR smartphone

-----Original Message-----

From: "John Viescas" <john@viescas.com>

Sender: MS_Access_Professionals@yahoogroups.com

Date: Sat, 25 Jun 2011 08:11:02

To: <MS_Access_Professionals@yahoogroups.com>

Reply-To: MS_Access_Professionals@yahoogroups.com

Subject: RE: [MS_AccessPros] How do I make the query I need?

Edgar-

That is correct as long as Interval contains a number of days. You can always

add an integer value to a date/time to get another date/time value - a date

either in the future (add a positive interval) or a date in the past (a negative

interval).

John Viescas, author

Microsoft Office Access 2010 Inside Out

Microsoft Office Access 2007 Inside Out

Building Microsoft Access Applications

Microsoft Office Access 2003 Inside Out

SQL Queries for Mere Mortals

http://www.viescas.com/

(Paris, France)

-----Original Message-----

From: MS_Access_Professionals@yahoogroups.com

[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of

rivera_vazquez_edgar

Sent: Saturday, June 25, 2011 12:33 AM

To: MS_Access_Professionals@yahoogroups.com

Subject: [MS_AccessPros] How do I make the query I need?

Hello to all.

I'm working with my main form but need a little help. The form is called

frmCustomerDetail. In this form I have a few tabs: General Info, Contacts, and

Addresses. In the Address tab I have a sub-form using my 'tblInventory', wich

has the inventory found in that specific address, so far so good.

Now I need a sub-form within the 'frmInventory subform' using the 'tblServices'.

The catch is that the 'tblServices' has the following fields: IdService(PK),

IdInventory(FK), ServDate (formated as NOW() ), Service (to identify the service

done to that specific item), Interval (to state how often that item should

recieve service, expressed in days), and now I need to make another field wich

takes the ServDate value and adds the Interval value to get the NxtServDate

(next service date for that item).

Here is what I think I should do:

Make a query with all the fields in tblService and add a field in that query for

the next service date. For example: NxtServDate: [ServDate] + [Interval]

Is this correct, or is there a better way to do this?

As always, Edgar

------------------------------------

Yahoo! Groups Links

[Non-text portions of this message have been removed]

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar