|
First) If in Tools menu > Options > Tables/Queries > Is not checked "SQL Server (ANSI 92) Compatible syntax - This database" (which is IMPLICIT option in Access)
then NVARCHAR is not recognise by Access. Instead you must use Text data type.
Solution: query must be rewrite thus:
CREATE TABLE [1384/6] <br />
(<br />
OrderTable int NOT NULL ,<br />
OrderNo int NOT NULL,<br />
OrderTypeIDn text(20) NOT NULL, <br />
Report text(254) NOT NULL,<br />
Receptionist text(50) NOT NULL ,<br />
Cashier text(254) NOT NULL,<br />
Day text(15) NOT NULL,<br />
TimeInstant text(15) NOT NULL,<br />
Description text(254) <br />
)<br />
Second) If in Tools menu > Options > Tables/Queries > Is checked "SQL Server (ANSI 92) Compatible syntax - This database" then NVARCHAR is now recognise by Access
but the problem is "Day" field name wich is reserved word because is the name of DAY function from SQL Server - DAY(date) return a integer representing number of day (between 1 and 31)
Solution:
<br />
CREATE TABLE [1384/6] <br />
(<br />
OrderTable int NOT NULL ,<br />
OrderNo int NOT NULL,<br />
OrderTypeIDn nvarchar(20) NOT NULL,<br />
Report nvarchar(254) NOT NULL,<br />
Receptionist nvarchar(50) NOT NULL ,<br />
Cashier nvarchar(254) NOT NULL,<br />
DayField nvarchar(15) NOT NULL,<br />
TimeInstant nvarchar(15) NOT NULL,<br />
Description nvarchar(254) <br />
)<br />
Ok ?
---
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
<ticker> <name> <date> <close> <corp-action> <class>
524348 AARTI DRUGS 8/1/2005 162 Pharm-Ind-B Drug
524348 AARTI DRUGS 1/3/2005 165
524348 AARTI DRUGS 1/3/2005 170
524208 yyyyy INDUST 1/3/2005 365
524208 yyyyy INDUST 8/1/2005 150 Chemicals
524208 yyyyy INDUST 8/1/2005 121 Chemicals </code>
I wanted to get result something like this:
524348 AARTI DRUGS 8
524208 yyyyy INDUST 244
that is <ticker>,<name>, difference between the maximum and minum <close> prices
thanks in advance
-- modified at 5:41 Wednesday 31st August, 2005
|
|
|
|
|
|
Colin Angus Mackay wrote:
Does this help?
Yes, it did the trick.
Thank you Colin Angus Mackay
|
|
|
|
|
don't we have to set a distinct on ticker and name to have them once ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
don't we have to set a distinct on ticker and name to have them once ?
No, becuase the GROUP BY clause is being used to define the level of aggregation. The query is saying that it wants only one row per ticker & name combination and that aggregation functions will be used on other columns to roll them into one value. In this case the MIN() and MAX() functions are used to create one value from the "close" column based on all the values within each ticker/name combination.
For example.
Lets say that the data is something like this:
Ticker Name Close
PRD Pernod Ricard 9000
PRD Pernod Ricard 9058
PRD Pernod Ricard 8945
PRD Pernod Ricard 8988
SSE Scottish & Southern Elec 978
SSE Scottish & Southern Elec 977
SSE Scottish & Southern Elec 969
SSE Scottish & Southern Elec 975
EZY EasyJet 235
EZY EasyJet 240
EZY EasyJet 233
EZY EasyJet 237
EZY EasyJet 232 Now we apply the SQL statment:
SELECT Ticker, Name, MIN(Close) AS MinClose, MAX(Close) as MaxClose
FROM StockData
GROUP BY Ticker, Name The result will be:
Ticker Name MinClose MaxClose
PRD Pernod Ricard 8945 9058
SSE Scottish & Southern Elec 969 978
EZY EasyJet 233 240 If you attempt to put any other columns in the SELECT you will get an error to say that they must either be used in an aggregate function or in the GROUP BY clause.
Does this help?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-- modified at 14:21 Wednesday 31st August, 2005
|
|
|
|
|
hi all,
how can i store the image file(.jpg,.gif,.bmp etc) to database. i am using SQl Server 2000. what will be the datatype of the field
thank you all
|
|
|
|
|
type : binary.
works fine for me for jpg, jpg, bmp and so...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How do u store it programmatically, I am using VB 6.0 / .Net for example?
|
|
|
|
|
actually, i did it wihin a java code, but the server was a SQL Server 2000.
do you want it nevertheless ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
If you don't mind yes, I'm also coding in java more basics only
Thank You.
|
|
|
|
|
if (getPicture() != null) {
ByteArrayInputStream inStream;
inStream = new ByteArrayInputStream(getPicture());
rqt.setBinaryStream(1, inStream, inStream.available());
}
in my bean :
private byte[] picture;
public byte[] getPicture() {
return picture;
}
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Why are use type data is image
|
|
|
|
|
sorry, maybe my englishis too poor to understand yours...
but i'd like you to reformulate your query please...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Trying (and having trouble understanding) to understand "inverse" ...
Quoting documentation:
"You may map a bidirectional one-to-many association by mapping a one-to-many association to the same table column(s) as a many-to-one association and declaring the many-valued end inverse="true".
...
...
...
<many-to-one name="Parent" column="parent_id" not-null="true"
(We also need to add the Parent property to the Child class.)
Now that the Child entity is managing the state of the link, we tell the collection not to update the link. We use the inverse attribute.
<set name="Children" inverse="true">
<key column="parent_id" />
<one-to-many class="Child" />
</set>
What's meant by "managing the state of the link"???
Reference:
http://nhibernate.sourceforge.net/nh-docs/en/html/single/reference.html#collections
Thanks in advance!
Norman Fung
|
|
|
|
|
Hi guys,
how can i make my sql database read and store data from Oracle db?
because my system reads data from sql database.. but some data need to be read from oracle and stored in sql database so the system can retrieve them from the sql database..
can anyone help me in this case? i don't know how to connect 2 different databases ...
ASP.NET/VB.NET
Regards,
Nina
|
|
|
|
|
You could connect the Oracle db as a linked server and use direct SQL commands between the two servers on the SQL Server side. Look up the books online for linked servers. You will have to configure an ODBC to oracle server from your SQL box.
|
|
|
|
|
Can you please write the connection string?? ( one example please..)
|
|
|
|
|
There's a list in the code project
http://www.codeproject.com/database/connectionstrings.asp
|
|
|
|
|
hi
I am making a software that will handle a database of 5 crore records. Please help me how to handle these many records. How should I design the database?
shelly
|
|
|
|
|
hunjan wrote:
a database of 5 crore records.
I'm not sure how you mean - 5 core records of what ? If you gave a little more info, perhaps we could make a suggestion. What's a federated server ? How is that part of the DB design ? What are you storing exactly ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
The only reliable way to tell what level of hardware you need to run on is to load test your application. Proper design and indexing can typically make a performance difference of 10-100x. So a well designed and implemented system can easly run on a tenth of the hardware of a poorly designed one.
BTW I've worked on non-federated SQL servers with billion row tables and thousands of concurrent users and as long as we kept everything well tuned we didn't have any problems.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
I tried to install MSDE on windows XP but the installation near the end and its Rollback , i tried to install Server service but its already installed and running i tried to check File and Prenter Sharing but it is installed and running , how could i pass this problem i am using MSDE whtch came inside SQl Standard Edition CD
agmb
|
|
|
|
|
Probably there was a previous installation of SQL Server/MSDE that was uninstalled. When SQL Server is uninstalled, databases are not deleted. Check C:\Program Files\Microsoft SQL Server for existance, and delete everything in it.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
i am using VB 6 as front-end and SQL Server 2000 as back-end, we have one web site that having database to store the daily activities of the marketing executives.
i've to connect my VB6 forms to database which is in the net and generate the reports. im using ADO as database connectivity. How to connect my ADO connetion object to web database. what will be the connection string
|
|
|
|