<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Problematic SQL Data Retrieval</title><link>https://www.infopathdev.com:443/forums/thread/3828.aspx</link><pubDate>Thu, 18 Jan 2007 06:38:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3828</guid><dc:creator>lyntonS</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3828.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3828</wfw:commentRss><description>Thanks for the help. I was able to solve the problem using the following SQL Express Insert Query:&lt;br /&gt;&lt;br /&gt;... &lt;br /&gt;AS&lt;br /&gt;	SET NOCOUNT OFF;&lt;br /&gt;&lt;br /&gt;SELECT&lt;br /&gt;	@EmpCode = max(EmpCode)&lt;br /&gt;FROM&lt;br /&gt;	Employees&lt;br /&gt;WHERE&lt;br /&gt;	EmpCode like upper(substring(@Firstname,1,1)+substring(@Surname,1,1)) +'%'&lt;br /&gt;&lt;br /&gt;IF @EmpCode is null&lt;br /&gt;	set @EmpCode = upper(substring(@Firstname,1,1)+substring(@Surname,1,1)) + '001';&lt;br /&gt;ELSE&lt;br /&gt;BEGIN&lt;br /&gt;	DECLARE @EmpCodeNo int;&lt;br /&gt;	SET @EmpCodeNo = Cast(substring(@EmpCode,3,3) as int) + 1;&lt;br /&gt;	SET @EmpCode = upper(substring(@Firstname,1,1)+substring(@Surname,1,1)) + replicate('0',3-len(@EmpCodeNo)) + cast(@EmpCodeNo as varchar);&lt;br /&gt;END&lt;br /&gt;&lt;br /&gt;INSERT INTO  ...&lt;br /&gt;&lt;br /&gt;I included it so that if anyone else new to the topic could learn from it.&lt;br /&gt;&lt;br /&gt;Chow!</description></item><item><title>Re: Problematic SQL Data Retrieval</title><link>https://www.infopathdev.com:443/forums/thread/3827.aspx</link><pubDate>Thu, 11 Jan 2007 18:28:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:3827</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/3827.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=3827</wfw:commentRss><description>Hi Lynton and welcome to the developing community - it's a wonderous place!&lt;br /&gt;&lt;br /&gt;The first problem is pretty interesting and I spent a little bit of time trying to figure the exact statement out and I got close but not 100%.  The only problem is a type casting issue.  You should be able to cast the number to a string, and then you'll need to add logic to add the zero-padding if necessary.  The statement I made is pasted below.  You should put this statement in the formula section of the 'Computer Column' property for the column in SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;The second problem is a repeat of your other post to which I have already reply.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;	upper(substring(T.FirstName, 1, 1))&lt;br /&gt;+ upper(substring(T.SurName,1,1))&lt;br /&gt;+ ((select count(*) from Names where upper(substring(FirstName,1,1)) = upper(substring(T.FirstName,1,1)) and upper(substring(SurName,1,1)) = upper(substring(T.SurName,1,1)))+1)&lt;/pre&gt;</description></item><item><title>Problematic SQL Data Retrieval</title><link>https://www.infopathdev.com:443/forums/thread/1791.aspx</link><pubDate>Thu, 11 Jan 2007 08:01:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:1791</guid><dc:creator>lyntonS</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/1791.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=1791</wfw:commentRss><description>I have been asked to design a staffing solution for a local company using InfoPath and a Web Service which connects to a SQL Express Database. There are two things I am struggling with as I am currently new to the developing community. &lt;br /&gt;&lt;br /&gt;1.) I need to generate a unique id. based on the first letter of the SQL field 'FirstName' and the first letter of 'Surname', followed by three incrementing numbers. e.g John Smith would be JS001, with the next alphabetically assigned person becoming JS002. Sounds simply enough by I am struggling immensely with it. HELP!&lt;br /&gt;&lt;br /&gt;2.) I am able to submit the form record successfully to the SQL database. The problem which arises is as follows. InfoPath Drop-Down List values which are successful posted to SQL are not being retrieved when I submit the query based on the 'empCode' of the record. Only the default 'Select...' appears? All the other data is being retrieved and displayed as normal.</description></item></channel></rss>