Code compiles but I get alot of errors for line "SELECT Substring ..." because chemicalId, chemicalTitle, chemicalDescription, chemicalCountry, chemicalState, chemicalCity, etc. gets the following errors:
Invalid column name 'chemicalId'
Invalid column name 'chemicalTitle'
Invalid column name...
I would like to be able to generate a Unique ID string (varchar 20) that is based on a datetime field (RecordCreated) and an algorithm.
eg.
2001-08-21 21:08:11.620 -> ef2108g11x620y8a331g082101
where "ef", "g", "x" and "y8a331g" are randomly created letters and or numbers in...
I have this working in VB. How can I create a SQL Function to do something similar? I am not good with SQL syntax.
ie.
123 -> 123
1000 -> 1,000
10000 -> 10,000
200000 -> 200,000
5000000 -> 5,000,000
100000000 -> 100,000,000
function Make_Comma_Number(Data)
HowMany = Len(Data)...
I am trying to get a list of pilots by flightId using a cursor. My select returns all the information I need but it returns records by flightId.
select fp.*, p.*, f.*
from flightPilot fp, pilot p, flight f
where f.FlightStatusId = 2
and fp.pilotId = p.pilotId
and f.flightId = fp.flightId...
Due to SQL limitation to varchar(8000) for local variables, I am trying to using a Temp Table to break the values into three varchar (8000). I would like to use another TEMP table in the code below, so @body can be TEXT and allocate the @body value into three varchar (8000) variable so I can...
have played around with permissions but I still can't get our website to work without having to logon with a username / password.
Our test site required a username / password but our Default Website is working perfectly via a browser.
Default Website:
http://localhost/v3/home.asp -> no...
I have played around with permissions but I still can't get our website to work without having to logon with a username / password.
Our test site required a username / password but our Default Website is working perfectly via a browser.
Default Website:
http://localhost/v3/home.asp -> no...
I have a datetime field, LastUpdate and I would like to return records with LastUpdate datetime within the last 24 hours. How can I do this?
Pseudocode:
Where LastUpdate is >= 24 hours ago ...
Due to poor design, we have a price field that is a varchar in the database. In a SQL stored procedure how can I add commas to this varchar and print out a varchar?
eg.
10000000 -> 10,000,000
5999 -> 5,999
2123112 -> 2,123,112
123 -> 123
332189 -> 332,189
I have the following logic in a SQL Stored Prodecedure. I want the stored procedure to return 'yes' if exists if false. The problem is if exists is true, select ... 2 returns no data. If this is the case (that select ... 2 returns no records), how can I return 'no' using the logic below?
if...
I have a Dell 1750 server and need help configuring RAID. I installed Windows 2000 server, but the server only shows 4GB of space when I have three 146GB drives.
I used the Dell CDs that came with the software and followed the screens and it appears that RAID has been set up, but after...
I am trying to merge these 2 Select statements:
1)
SELECT a.*,
b.flightPilotAssignedTimestamp
FROM Pilot a,
(SELECT pilotid,
MAX(flightPilotAssignedTimestamp) flightPilotAssignedTimestamp
FROM FlightPilot
GROUP BY pilotid) b...
I am trying to merge the 2 Selects:
1)
SELECT b.TotalNoAssignedFlights,
a.*, c.*
FROM Flight a, FlightPilot c,
(SELECT count(distinct(FlightId)) TotalNoAssignedFlights from FlightPilot WHERE PilotId = @PilotId) b
WHERE a.FlightId IN (SELECT distinct(lrl.FlightId) from...
Inside my stored procedure, I would like to store the pilotActiveSinceTimestamp into the variable @myActiveSinceTS. If @myActiveSinceTS is null, I would like to update the pilotActiveSinceTimestamp to date(). What is the syntax to do this?
@myActiveSinceTS = select pilotActiveSinceTimestamp...
Inside my stored procedure, I have the following logic:
if exists(select * <<1>>)
begin
select * ...
end
else if exists(select * <<2>>)
begin
select 'no records'
end
else
select 'you do not have access'
end
Basically I want to return records from <<1>> if there are records. If not...
I am try to merge merge these 2 statements into a Single select and add a checkedField with values Y or N. All records from PlaneType should be returned and checkField = Y if a pilot has that specific PlaneTypeId.
PlaneType Table:
PlaneTypeId (primary key), PlaneTypeDescription
PilotPlaneType...
I am try to retrieve all fields for non Southwest Pilots from the Pilot table but I only want unique emails. The reason is because there are some pilots with duplicate records.
--no error but I need all fields
select distinct(pilotEmail1)
from Pilot
where pilotEmail1 NOT LIKE...
I have 2 selects that I am
trying to integrate into 1 statement. I am trying to
get each pilot's last assigned flight from the
FlightPilot table. I am also trying to get all pilots
for a specific flight according to flightType,
flightLocation, and flightPath. The resulting single
select...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.