Group:  Microsoft Access ยป microsoft.public.access.adp.sqlserver
Thread: duedate

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

duedate
"gmenon100" <u24255[ at ]uwe> 18.07.2006 15:18:19
I am a novice to Access and I have a small Access project file and need to
use the below, can some help me with formulating :

[subdate], [duedate] & [shipmode] being the fields in a query.

i want to formulate

[duedate] = if [shipmode] = "AIR", duedate + 30 days
if [shipmode] = "OCEAN" duedate + 60days
Re: duedate
"AkAlan via AccessMonster.com" <u18147[ at ]uwe> 18.07.2006 19:32:12
in the duedate field use an IIF statement

IIF([shipmode] = "Air","30","60")
This will only work if there are only two shipmodes. If there are more you
can use nested IIF statements otherwise I would write a function to handle it.



gmenon100 wrote:
[Quoted Text]
>I am a novice to Access and I have a small Access project file and need to
>use the below, can some help me with formulating :
>
>[subdate], [duedate] & [shipmode] being the fields in a query.
>
>i want to formulate
>
>[duedate] = if [shipmode] = "AIR", duedate + 30 days
>if [shipmode] = "OCEAN" duedate + 60days

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-adp-sqlserver/200607/1
Re: duedate
"Robert Morley" <rmorley[ at ]magma.ca.N0.Freak1n.sparn> 19.07.2006 00:45:28
If this is an Access project and you're using a SQL Server back end, then
IIF won't work; use a CASE statement.

Instead of "shipmode", you would enter "CASE [shipmode] WHEN 'AIR' THEN
[duedate] + 30 WHEN 'OCEAN' THEN [duedate] + 60 END"



Rob

"gmenon100" <u24255[ at ]uwe> wrote in message news:636f79da1ffed[ at ]uwe...
[Quoted Text]
>I am a novice to Access and I have a small Access project file and need to
> use the below, can some help me with formulating :
>
> [subdate], [duedate] & [shipmode] being the fields in a query.
>
> i want to formulate
>
> [duedate] = if [shipmode] = "AIR", duedate + 30 days
> if [shipmode] = "OCEAN" duedate + 60days


Re: duedate
"gmenon100 via AccessMonster.com" <u24255[ at ]uwe> 19.07.2006 13:01:31
Thank you Robert, It worked with the case statement. I really appreciate your
help. This was my first Access project and my first posting. I may need some
help as I advance further. Thanks again.

Robert Morley wrote:
[Quoted Text]
>If this is an Access project and you're using a SQL Server back end, then
>IIF won't work; use a CASE statement.
>
>Instead of "shipmode", you would enter "CASE [shipmode] WHEN 'AIR' THEN
>[duedate] + 30 WHEN 'OCEAN' THEN [duedate] + 60 END"
>
>Rob
>
>>I am a novice to Access and I have a small Access project file and need to
>> use the below, can some help me with formulating :
>[quoted text clipped - 5 lines]
>> [duedate] = if [shipmode] = "AIR", duedate + 30 days
>> if [shipmode] = "OCEAN" duedate + 60days

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-adp-sqlserver/200607/1
Re: duedate
"gmenon100 via AccessMonster.com" <u24255[ at ]uwe> 19.07.2006 13:33:34
Thanks Alan,

It worked with the CASE statement given by Robert. Appreciate your response.

AkAlan wrote:
[Quoted Text]
>in the duedate field use an IIF statement
>
>IIF([shipmode] = "Air","30","60")
>This will only work if there are only two shipmodes. If there are more you
>can use nested IIF statements otherwise I would write a function to handle it.
>
>>I am a novice to Access and I have a small Access project file and need to
>>use the below, can some help me with formulating :
>[quoted text clipped - 5 lines]
>>[duedate] = if [shipmode] = "AIR", duedate + 30 days
>>if [shipmode] = "OCEAN" duedate + 60days

--
Message posted via http://www.accessmonster.com

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net