You are here: Re: using lookup and display only field as control field « MsSQL Server « IT news, forums, messages
Re: using lookup and display only field as control field

Posted by Erland Sommarskog on 09/30/12 11:48

(jim.murphy@travelinsurance.ca) writes:
> I am not sure If I can do this with a lookup, but what I would like to
> do is perhaps use lookup to retrieve a control date from an
> unassociated table to control what date is entered in another table.
> For example :
> the main table , table 1 has many entries with a field called date_
> enter which is the date the record was entered.
> table 2 has a control_date
> If the date entered in table 1 is less than or = to the control date we
>
> want to give the user a error message.
> I am thinking of using display only field and lookup to set it
> Would need to have the date value from the control table available to
> the active table of table 1 when entering the the date_enter.
> However as there is no join field between the two tables am not sure
> how to do it. Was thinking might have to add a key field that was
> allways null and in the BEFORE EDITADD EDITUPDATE section set it so
> that the key would be null

I can't see how a NULL key field would help you. Besides a NULL key value
sounds like an oxymoron.

If table2 has a single row, the check can easily be implemented as a
trigger. If there are multiple rows in table2, you will have to have
some set of rules to determine which row to use. And sorry, we can't
assist you, since we don't know the tables nor data.

> Am using Informix 5 , Any help would be apprecia

What's wrong with comp.databases.informix? This newsgroups is for
MS SQL Server, so the syntax you would get in this newsgroup may not
work for you.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация