PDA

View Full Version : Query works in display mode but cannot export


marygb
02-23-2007, 06:48 PM
I am trying to get a query together to create a csv file to import users into our new vB Forum.

This query looks ok in display mode:
SELECT ID, LastName, FirstName, Nickname, Email, Pwd,
IF (Nickname is null or Nickname = '',
CONCAT (REPLACE (LastName, ' ' , ''), ',', REPLACE (FirstName, ' ', '')),
CONCAT (REPLACE (LastName, ' ', '') , '.', REPLACE (Nickname, ' ', ''))) as UserName
FROM `memberinfo2`
WHERE MemberTypeCD = 'MEMB' and StatusCD = 'ACTV'

If I try to export it to a csv file, I don't get the data but get a file of meta tags

I also tried to just add a new field and update the field using a similiar query but could not get it to update
update memberinfo2Prod
set ForumUserName =
IF (Nickname is null or Nickname = '',
CONCAT (REPLACE (LastName, ' ' , ''), ',', REPLACE (FirstName, ' ', '')),
CONCAT (REPLACE (LastName, ' ', '') , '.', REPLACE (Nickname, ' ', '')))
WHERE MemberTypeCD = 'MEMB' and StatusCD = 'ACTV'