Thursday, March 29, 2012
Help with Crystal Reports
I have a simple report that is to be done......
I need to generate a report....with columns...emp_num,name,ssn
I pull up these columns thru sql server 2000 from Employee table...
The tricky part is here....
The report has to be in such a way that...
1.)First it prompts asking if u have ssn number with u ,if yes enter the ssn no., display the name and emp_num corresponding to that,
2.)IF NO...prompt the user asking for emp_num, if yes ,enter the emp_num ,display the name and ssn corresponding to that...
I've written a stored procedure for this, but this is taking only one value..while connecting to the crystal....
Plz help me on this.......I dont think you can prompt user this way
Are you calling the report from any front end?
Tuesday, March 27, 2012
Help with combining Sql Statements
I'm trying to combine the following two strings to create a single Insert statement (and thus only generate one record instead of two).
insertString ="Insert comments (uID) Select uID FROM users WHERE uName = @.uName"
insertString2 ="INSERT comments (eventID, text) VALUES ( @.eventID, @.comment)"
I have tried:
Insert comments (uID, eventID, text)SELECT uID FROM users WHERE uName = @.uNameVALUES(uID, @.eventID, @.comment)
Individually they work fine, but I can't get the syntax correct to allow them to work together. As you can tell, I'm not very good with SQL, so any help would be greatly appreciated!
Thanks in advance.
Try it like this:INSERT INTO comments (uID, eventID, [text])SELECT uID,@.eventID, @.comment FROM users WHERE uName = @.uName
|||Spot on, thank you very much!