|
Try to insert a CreatedDate record When ever you try to fire a queary in Datbase.
|
|
|
|
|
imshally81 wrote: today inserted record,yesterday inserted record,last 7 days inserted record,last 30 days inserted record and last year inserted record..
You want the last number of days right? How about this?
SELECT tbl.DateColumn
FROM tbl
WHERE tbl.DateColumn Between Date() And DateAdd("d",-7,Date());
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
hi all,
I need to find IRR Value to my Web Application.So Now I need a SQL Function which return IRR Value.
Can any body please help me how to find it using a SQL Function ?
Thanks in advance...
|
|
|
|
|
pubududilena wrote: Internal Return Rate
I don't know what an IRR value is. If you have a calculation for this then it would help.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Hi
Is there any reason I could not use VS2005 with SQL Server 2000. I have just started at a new organisation and they already have SQL Server 2000 (with no plans to upgrade). They don't, however, have any development tools, so I am looking at using VS2005.
Any input would be greatfully accepted.
Alec
|
|
|
|
|
I'm in need of some sql help
SELECT P1.name, P2.name , J.text FROM person p1, person p2, job J WHERE P1.persID = J.creatorID AND P2.persID = J.responsibleID AND J.id = 1
the above statement does not return any rows if the job J has null in the responsible field. But I want it to return an empty string for P2.name in that case. Is that possible. Would be thankful for any help!
|
|
|
|
|
You need an OUTER join. Start with this query.
SELECT p1.name as p1name, isNULL(p2.name, '') as p2name , J.text<br />
FROM person p1 INNER JOIN<br />
job J ON p1.persID = J.creatorID LEFT OUTER JOIN<br />
person p2 ON J.responsibleID = p2.persID<br />
WHERE (J.id = 1)
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
Hello!
I have a problem to write a query.
this is the query:
<br />
SELECT Description, COUNT(DISTINCT id_stud)<br />
FROM Student,School<br />
ecc...<br />
ecc...<br />
When i run this code an error appear. It says Syntax Error near Distinct...
Any suggestion?
How can i solve?
Thank You
Enrico
VentoEngine corp.
Program your life ^
|
|
|
|
|
Post the complete query. You need to have a GROUP BY along with JOIN s in your query b/c of an aggregate function.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
the complete query is:
<br />
SELECT Description,COUNT(DISTINCT id_Stud)<br />
FROM Studenti, Istituti<br />
WHERE Studenti.id_Istituto = Istituti.id_Istituto<br />
GROUP BY Description;<br />
But the Distinct syntax is wrong i think...
VentoEngine corp.
Program your life ^^
|
|
|
|
|
Syntax looks fine, look for field name typos.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
What do you mean?
I wrote it on Access too but it doesn't work..
I use an OdbcDataSet to retrive this information..maybe it's a DataSet's problem, i dont know!
VentoEngine corp.
Program your life ^^
|
|
|
|
|
Post your tables structure here.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
ok, i have 5 tables:
Studenti(student):
fields -> CodiceStud(PK),NomeStud,CognStud,DataNascita,Classe,
CodiceIstituto(FK)
Istituti(school):
fields -> CodiceIstituto(PK),Denominazione,Indirizzo,Telefono
Professori(teachers):
fields -> CodiceProf(PK),CognProf,NomeProf,CodiceIstituto(FK),
CodiceManif(FK)
Manifestazioni(Competition):
fields -> CodiceManif(PK),Descrizione,Luogo,DataInizio
Iscrizioni(inscriptions):
fields -> CodiceStud(FK),CodiceManif(FK),DataInizio
The "inscriptions" table result from the N:N relation between student and competition.
The tables i need for the query are student and school only.
With this query i want to have as result the list of the school with the number of students who take part in one of the competition.
PS: Without the Distinct function, if a student take part in more then one competition he will be counted more time...
VentoEngine corp.
Program your life ^^
|
|
|
|
|
You could start with this rather not-so-elegant query and then fine tune it to your taste.
Select i.Denominazione, count(s.CodiceStud)
From Istituti i INNER JOIN Studenti s ON i.CodiceIstituto = s.CodiceIstituto
Where Exists
(
Select DISTINCT Iscrizioni.CodiceStud
From Iscrizioni
Where Iscrizioni.CodiceStud = s.CodiceStud
)
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
what are the letters "i" and "s" ?
VentoEngine corp.
Program your life ^^
|
|
|
|
|
ventomito wrote: what are the letters "i" and "s" ?
Aliases for table names.
You can define as alias like this:
SELECT * FROM MyTable t
INNER JOIN OtherTable o ON ....
where the alias comes immediately after the occurrance of the table name in the FROM or JOIN clause. I prefer to make this more explicit by writing it like this:
SELECT * FROM MyTable AS t
INNER JOIN OtherTable AS o ON ....
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
Colin Angus Mackay wrote: I prefer to make this more explicit by writing it like this
In my opinion, it makes it easier to read when using aliases
|
|
|
|
|
Im a beginner so im going to ask a stupid question that i did not find an anserw to in the documentation.
Is it possible to connect to sql 2005 over internet? So far i only done it with intranet.
If it is possible, could somebody tell me how it is done, or show me to an article concerning the subject?
(would also apreciate some security aspects that need to be considered)
R
Johan
|
|
|
|
|
john1113334 wrote: Is it possible to connect to sql 2005 over internet?
I should be. I don't see why not, it is just TCP/IP traffic. A firewall might block it, of course.
john1113334 wrote: would also apreciate some security aspects that need to be considered
SQL Injection attacks and tips on how to prevent it[^]
Also, exposing your SQL Server over the internet is a security risk. Normally it should sit behind an propertly configured firewall so that it can only be used on an internal network. If you must expose it over the internet you should consider some sort of VPN (Virtual Private Network).
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
hello all i have a problem and want to ask for solution
which is
i have make a webservice and i have connect the database with it and i have try it and its working but on THE LOCAL HOST , the problem that i reserve a domian its free ar somee.com and i dont know how to make the datasoure of the connections on that server i.e domain so any body help me please.
thanx
tedy
|
|
|
|
|
Read their support docs at http://somee.com/Support.aspx[^]. There is section dedicated to database related FAQs.
Farhan Noor Qureshi
if (this == this) thow this;
|
|
|
|
|
I need to include a column in an SQL Server table, which can hyperlink to some text stored somewhere inside or outside the same database.
Please help.
-- modified at 1:18 Wednesday 30th November, 2005
|
|
|
|
|
R. A. Abbasi wrote: I need to include a column in an SQL Server table, which can hyperlink to some text stored somewhere inside or outside the same database.
In case of the text store in the database you should scan through the table and search for the text that you need by using SELECT statement. Check here for the SELECT statment information.[^]
In case of the text outside the database you should know the file path. The field that you are create must store the file path and point to the specific file that you need to open it. Check here for the information about read and write to text file.[^]
|
|
|
|
|
Comparing only Time in Sql?
Hi Dears!
I have two Different DateTime Values i want to Compare only their times independent of Dates How to do it?
let
DateTime @dt1='2004-10-30 19:30:00.917'
DateTime @dt2='2005-11-29 15:00:00.917'
accordint to my requirements
@dt1>=@dt2 should be true as 19:30>=15:00
because i have to compare only the time not the Date how to achieve this in sql .Function required.
|
|
|
|