Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-03-2006, 11:26 PM
Nakrom Nakrom is offline
Senior Member
 
Join Date: Feb 2006
Location: Cape Twon
Posts: 118
Send a message via MSN to Nakrom Send a message via Skype™ to Nakrom
Default Format$ Error in a SQL Statement

Hi guys
I know this question should'nt apear here (but maybe it should). anyway i have a SQL string thats giving me grief:
[SQL]
SELECT Plan.PlanID, Plan.PlanTime, Plan.PlanDuration, Format$([PlanTime],"dddd") AS [Day], Plan.Note
FROM Plan
WHERE (((Plan.Old)=False))
ORDER BY Plan.PlanTime, Plan.PlanDuration DESC;
[/SQL]

now the problem i have is that it tells me that Format$ is an undefined function. but i know that it works as it works on one pc but not on another.

please help.


Thanks

Markus

Loyalty is everything, except Honor.
Reply With Quote
  #2  
Old 12-04-2006, 12:28 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Format$ Error in a SQL Statement

What database do you use? MS SQL? Oracle? DB2?...

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #3  
Old 12-04-2006, 12:32 AM
Nakrom Nakrom is offline
Senior Member
 
Join Date: Feb 2006
Location: Cape Twon
Posts: 118
Send a message via MSN to Nakrom Send a message via Skype™ to Nakrom
Default RE: Format$ Error in a SQL Statement

I am using a MS Access Database and the Query runs inside the MS Access Database.

Thanks

Markus

Loyalty is everything, except Honor.
Reply With Quote
  #4  
Old 12-04-2006, 02:20 AM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Format$ Error in a SQL Statement

SELECT PlanID, PlanTime, PlanDuration, Format([PlanTime], "dddd") AS [Day], Note
FROM Plan
...

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #5  
Old 12-04-2006, 03:10 AM
Nakrom Nakrom is offline
Senior Member
 
Join Date: Feb 2006
Location: Cape Twon
Posts: 118
Send a message via MSN to Nakrom Send a message via Skype™ to Nakrom
Default RE: Format$ Error in a SQL Statement

Sorry tried that one too and it gives the same error. but only from within Access! if i run it from a SQL Builder / Explorer, it work fine. so i am starting to think that it must be a security that prevents me from running a funtion or something like that

Thanks

Markus

Loyalty is everything, except Honor.
Reply With Quote
  #6  
Old 12-04-2006, 11:08 PM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Format$ Error in a SQL Statement

In MS Access environment you must use the another syntax.

The SQL which I posted, you may use from any external tool (DBExplorer, your Delphi code etc).

But inside MS Access, use their Visual Query Builder instead

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:13 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.