Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select error
Message
 
To
06/07/2006 15:46:21
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
01134260
Message ID:
01134266
Views:
11
>The following command works fine:
>
>select linkfile.*, aNodes.x as x1, aNodes.y as y1,;
>	bNodes.x as x2, bNodes.y as y2,;
>	abs(aNodes.x-bNodes.x) as dx, abs(aNodes.y-bNodes.y) as dy,;
>	'  ' as stddir, ;
>	'  ' as lh_node,;
>	.f. as _used ;
>	from linkfile ;
>	left join (lcNodefile) aNodes on linkfile.A == aNodes.n ;
>	left join (lcNodefile) bNodes on linkfile.B == bNodes.n ;
>	where st_name <> ' ' ;
>	order by st_name ;
>	into cursor crsOriginalLinks readwrite
>
>but when I change the 5th line to
>
>select linkfile.*, aNodes.x as x1, aNodes.y as y1,;
>	bNodes.x as x2, bNodes.y as y2,;
>	abs(aNodes.x-bNodes.x) as dx, abs(aNodes.y-bNodes.y) as dy,;
>	'  ' as stddir, ;
>	min(linkfile.A,linkfile.B) as lh_node,;
>	.f. as _used ;
>	from linkfile ;
>	left join (lcNodefile) aNodes on linkfile.A == aNodes.n ;
>	left join (lcNodefile) bNodes on linkfile.B == bNodes.n ;
>	where st_name <> ' ' ;
>	order by st_name ;
>	into cursor crsOriginalLinks readwrite
>
>I get an error on the changed line that says "Function name is missing ')'." Any suggestions as to what is happening and how to fix it?
>
>Thanks


MIN() in select is differenbt that MIN() native function. MIN() in select get the minimum value of the Field passed as parameter, so it accept only one parameter.
If you want to simulate MIN in select you could use:
select linkfile.*, aNodes.x as x1, aNodes.y as y1,;
	bNodes.x as x2, bNodes.y as y2,;
	abs(aNodes.x-bNodes.x) as dx, abs(aNodes.y-bNodes.y) as dy,;
	'  ' as stddir, ;
	IIF(linkfile.A<linkfile.B, linkfile.A, linkfile.B) as lh_node,;
	.f. as _used ;
	from linkfile ;
	left join (lcNodefile) aNodes on linkfile.A == aNodes.n ;
	left join (lcNodefile) bNodes on linkfile.B == bNodes.n ;
	where st_name <> ' ' ;
	order by st_name ;
	into cursor crsOriginalLinks readwrite
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform