|
It's a shame that I can't top Guy's answer. It is superb and gets to the point quickly and efficiently, when you have a question ask it politely.
Dhilipkumar wrote: i created three tables
I'm glad that you created three tables - it shows that you are a better carpenter than a coder. Perhaps you'd like to stay in that line.
Dhilipkumar wrote: i need to join the three tables
You might want to consider just pushing them together. That's what we will be doing at Christmas to make room for everybody.
|
|
|
|
|
You need a basic SQL reference manual. Perhaps O'Reilly's SQL Cookbook[^] would help you.
I could post a sample query but I really don't think you'd understand it, and the time and space to explain it isn't suitable for this forum.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
hi
i have a table that store applicant with their mark.
i want to get their grad in a query.
should i use a function and call for any applicant?
also if two applicant have same mark they must have same grade.
sepel
|
|
|
|
|
You need to decide whether the Grade is something an Applicant has, or not.
I suggest an Applicant has a Mark, and the Grade is calculated from the Mark. So your Applicant business object would have a Grade property that returns something based on the Mark.
|
|
|
|
|
thank.
you are right.
but in my database
how i calculate the grade.
i want to know if i can calculate all grade in one function or i must call a function instated of grade in my query so for each row the function is called again?
sepel
|
|
|
|
|
You could use a computed column on the table for a quick and easy database solution. Or you could just stick an extra property on your business objects.
The important thing to realise is that theres no real need to _store_ the Grade anywhere - because its easy to calculate.
|
|
|
|
|
thanks.i know your mean.
but how i calculate the grade?
sepel
|
|
|
|
|
Thats your algorithm, its really up to you. In Australia we say a High Distinction as above 85%, Distinction 75-85 etc etc.
You'll need to ask your client for this one.
|
|
|
|
|
|
I thought I'd post this, just in case anyone is struggling to get Entity Framework Beta 3 working in 64-Bit environments.
Microsoft's line is that the design time EF Beta 3 is not supported officially, yet, on x64 platforms. This leads to all manner of billy, including the csdl, msdl and ssdl mapping files not being generated.
The work around is incredibly simple:
Copy:
Microsoft.Data.Entity.Build.Tasks.dll
Microsoft.Data.Entity.targets
from %windir%\Microsoft.NET\Framework64\v3.5 to %windir\Microsoft.NET\Framework\v3.5
and then rebuild the project (F6).
"On one of my cards it said I had to find temperatures lower than -8. The numbers I uncovered were -6 and -7 so I thought I had won, and so did the woman in the shop. But when she scanned the card the machine said I hadn't.
"I phoned Camelot and they fobbed me off with some story that -6 is higher - not lower - than -8 but I'm not having it."
-Tina Farrell, a 23 year old thicky from Levenshulme, Manchester.
|
|
|
|
|
Hi All,
I am using SSRS2005 to generate the report. I have used Date Picker control. Date picker is working at runtime when I run directly, i.e. http//server ip/reports. But, When I call this report in VS 2005 (C# with ASP .Net 2.0) with Forms Authentication, date picker control refreshes the page and not working.
!!Any Help Please!!
modified on Monday, December 17, 2007 2:17:09 AM
|
|
|
|
|
Hi all,
I am facing a helllot of problems with views..
I created a view as
create view viewname as select * from tabel1;
but when i run an update query on the view , it updates it in the tabel1 tooooo
any help guys????
|
|
|
|
|
A view provides a way of looking at the data in a table or tables. A view holds no data in its own right, it simply represents a cached SQL SELECT statement that returns data from the underlying tables. A simple view like yours is updateable, because each row in the view can be mapped back to a row in the underlying table tabel1. This means that you can run insert/update/delete queries on the view as if it was a real table.
BTW, it's table, not tabel.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
pmarfleet wrote: BTW, it's table, not tabel.
oh... sorry it was a typo.
So how do i create a view such that the actual data is not altered.
I mean if i wan`t to test some queries on data. This is an ideal situation in online databases
|
|
|
|
|
newbie.net wrote: So how do i create a view such that the actual data is not altered.
I mean if i wan`t to test some queries on data.
I don't understand. How can you test an UPDATE query if you're not able to update any data?
In a typical software development setup, you would have a development environment that is separate from your production environment. Testing of code can be performed in the development environment without compromising the running of the production environment. Your development environment should replicate your production environment as closely as possible. This way, when you move your application from development to production it should behave predictably.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
My understanding was that views are not updatable in Microsoft SQL Server, unless you use an INSTEAD OF trigger to perform the updates on the base table.
Please post the exact version of the exact database server software that you're using with your questions. It saves a lot of time.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Mike Dimmick wrote: My understanding was that views are not updatable in Microsoft SQL Server, unless you use an INSTEAD OF trigger to perform the updates on the base table.
This isn't the case. I was able to run an update query on a simple view. The MSDN documentation states:
INSERT, UPDATE, and DELETE statements must also meet certain qualifications before they can reference an updatable view. UPDATE and INSERT statements can reference a view only if the view is updatable and the UPDATE or INSERT statement is written so that it modifies data in only one of the base tables referenced in FROM clause of the view. A DELETE statement can reference only a view that is updatable; the view must also reference exactly one table in its FROM clause.
AFAIK, a view is updateable if it returns rows of data that can be directly mapped back to rows of data in the underlying table that contains the fields being updated.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi,
In SQL How can I trim characters from result of select. (for example 0002120 in DB returns as 2120)
Best wishes
|
|
|
|
|
mehrdadc48 wrote: In SQL How can I trim characters from result of select. (for example 0002120 in DB returns as 2120)
What do you mean by 'trim'? In programming terms, this usually refers to removing leading or trailing white space in a sequence of characters. In your example, you appear to be referring to the removal of insignificant digits from the string representation of a number. You also haven't stated which database system you are using. Is it SQL Server, Access, Oracle or something else? If you are trying to remove insignificant digits and are using SQL Server, you could write a function which uses the PATINDEX function to find the position of the first non-zero digit in the string and then uses the SUBSTRING function to return all digits at and after this position.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
SELECT CAST(CAST('0001234' AS INT) AS VARCHAR(10))
Should also do the trick for you.
Regards
Guy
You always pass failure on the way to success.
|
|
|
|
|
Is it possible to utilize the TransferText function from a database table in MS Access to a TextFile object? I need to be able to write three lines of code to a file and then transfer the records from the database table to the very same file utilizing the TransferText approach because the file needs to be presented in a certain way to the .CSV file. Is this possible?
I would appreciate any assistance you could provide. Here is the code so far:
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(strNewOutputString, True)
strDatePicker = dteDatePicker.Value
dteMonth = Month(strDatePicker)
a.WriteLine ("ACTUALC")
a.WriteLine (dteMonth & ",,")
a.WriteLine (dteMonth & ",,")
'Needs to be able to transfer the text in this format using the "Standard Output" specification format.
DoCmd.TransferText acExportDelim, "Standard Output", _
"tblExportCSV", strNewOutputString, False
a.Close
modified on Friday, December 14, 2007 12:53:54 PM
|
|
|
|
|
Hello,
I am trying to get Random records from MS Access by using following query,
SELECT * FROM myTable ORDER BY rnd(id)
where id is the autonumber primary key of type integer.
Now the problem is, I am always getting same records every time I run the query. How can I get different Random sequence different time ? Would anyone give me a query to take SEED from Current Time's Tick for Rnd function ?
Regards
|
|
|
|
|
A quick Google search returned plenty of results[^] related to your question.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
All,
I have been toying with this query for some time now to no avail. I need to run a retention report on sales that canceled within 30, 60, 90 days of the original sale date. My query is below. Could someone please help me in the right direction as to why it doesn't work? The error I get is below the query
<br />
SELECT count(*) FROM db.orders<br />
where date_entered between "2007-08-01" and "2007-08-31" and cancel_date <= date_add('day', 30, date_entered)<br />
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '30, date_entered)' at line 2
Thank you very much!
|
|
|
|
|
Reference for DATE_ADD in MySQL 6.0[^].
I think the correct syntax would be DATE_ADD(date_entered, INTERVAL 30 DAY) .
MySQL is not SQL Server and they do not necessarily use the same syntax for features that both implement. There is a common but very limited standard SQL syntax; many databases support most of SQL-92, but usually not all of it.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|